I am running Homebrew with
oh-my-zsh. When I use tab completions with
brew, I end up with what looks like a double completion set—one which is a little more informative and only contains primary commands, and another below it which is a list of primary commands and aliases:
$ brew in⇥ info -- information about a formula install -- install a formula info instal install
I am wondering if this is the intended behavior, or if I might have a secondary
zsh completion configuration competing with the Homebrew built-in?
Also, the particularly-annoying
uninstal aliases impact command line completion, such that typing
brew ins⇥ results in
brew instal rather than
brew install␣ (with trailing space), meaning you have to hit
l⇥ or the space bar before inputting the formula name.
$ echo $fpath | tr " " "\n" /Users/chris/.oh-my-zsh/custom/plugins/zsh-autosuggestions /Users/chris/.oh-my-zsh/plugins/brew * * several other oh-my-zsh plugins * * /Users/chris/.oh-my-zsh/functions /Users/chris/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.3/functions
The only location containing a
_brew file is
/usr/local/share/zsh/site-functions, which is the Homebrew-installed symlink to
../../../Homebrew/completions/zsh/_brew. So I feel like this is coming from Homebrew’s
completions/zsh/_brew file, but I’m far from an expert on this topic, and apparently there’s some caching involved in
zshcompsys, so ¯\_(ツ)_/¯. (I have tried the recommended
rm -f ~/.zcompdump; compinit to refresh the completions cache, but to no avail.)
I have probably previously installed and subsequently uninstalled
homebrew-core/zsh-completions, but it’s not currently installed.
There is a merged PR removing the
bash completions, but I don’t see anything similar for the
If this isn’t Homebrew-related, hopefully someone can point me in the right direction to track down the source.
Conversely, if this is all coming from Homebrew’s
_brew completion file, I’d like to suggest removing
uninstal command line completion and the bottom command-only tab completion selections, leaving just the detailed options. For comparison, here’s what
$ git pu⇥ pull -- fetch from and merge with another repository or a local branch push -- update remote refs along with associated objects
I’m happy to create an issue for this, but I wanted to get confirmation first that it wasn’t something else on my system other than Homebrew that was causing it. (I’d love to help with a PR, but I took a look at
_brew alongside the bash completion diff from the PR linked above, and I have no earthly idea where to begin.)