Community Information
-
Homebrew completions not working in bash?
I'm not sure why my brew commands are not autocompleting, despite having followed the proper steps and trying numerous fixes I found. When I try to type part of a command and complete it as such: `$ brew ins<TAB>` Instead of completing it as expected, `$ brew install` I get the error `-bash: _brew: command not found` which is displayed right after what I had just typed like this: `$ brew in-bash: _brew: command not found` I have the following (brew related) lines in my `.bash_profile` (as in the brew documentation), eval "$(/opt/homebrew/bin/brew shellenv)" if type brew &>/dev/null then HOMEBREW_PREFIX="$(brew --prefix)" if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]] then source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" else for COMPLETION in "${HOMEBREW_PREFIX}/etc/bash_completion.d/"* do [[ -r "${COMPLETION}" ]] && source "${COMPLETION}" done fi fi and I have the `bash-completion` formula installed as well. I've tried to `brew unlink bash-completion && brew link bash-completion`, using `bash_completions@2` instead, and sourcing the completions directly, all with no luck. On top of this, completions for brew installed formulae also don't work, like for git for example. Am I missing something?3
© 2025 Indiareply.com. All rights reserved.