1

I've searched Google/Super User for a while and I couldn't find any problemas similar to what's happening to me, so I decided to ask a question.

My problem is the following: I have the same zsh/prompt/autocomplete configuration in two different machines: One running OSX and one running Ubuntu 17.04 (a VPS on digital ocean).

Most of the things works exactly the same, except for git autocompletion, as you can see from:

this screenshot

As you can see, the top window (macOS) shows little options to complete, while the bottom window (Ubuntu) shows all my aliases and stuff.

My question is: does anyone knows why this happens? Any idea on how I can fix it or how can I debug both of them to find where things go wrong in Mac?

Some more info:

macOS Version: 10.12.4
Zsh Version: zsh 5.3.1 (x86_64-apple-darwin16.3.0)
Git Version: git version 2.12.2

Ubuntu Version: 17.04
Zsh Version: zsh 5.2 (x86_64-ubuntu-linux-gnu)
Git Version: git version 2.11.0

1 Answer 1

2

So, I found this question where people mentioned the whence -v command.

Running whence -v _git (zsh completions functions usually follow the pattern _<command_name>), I've got two different results:

Ubuntu

$ whence -v _git
_git is an autoload shell function

macOS

$ whence -v git
_git is a shell function from /usr/local/share/zsh/site-functions/_git

Since I've installed git via Brew on my mac, /usr/local/share/zsh/site-functions/_git was a symlink to the brew completion file. I've deleted the symlink, reload my shell with exec zsh and everything worked as expected.

After that, I've removed git and reinstalled it without the completions:

brew remove git
brew install git --without-completions

And everything is working as expected!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .