Open narlei opened 4 years ago
I think it's because you cannot run brew install git --without-completions
anymore...
From my experience in this case I used this cmd autoload -Uz compinit && compinit
it will help to fix your problem.
Ref : https://stackoverflow.com/questions/24513873/git-tab-completion-not-working-in-zsh-on-mac
I'm having similar trouble with Bash on Catalina (brand new laptop, not an OS upgrade). Homebrew installation was fine, all the scripts and bash files are in the correct places, and I created a bash_profile because I didn't have one, and even set my shell to load with Bash Completion folder from the Terminal preferences. Any ideas? Thanks!
@thatdocslady I'm having similar trouble with Bash on Catalina (brand new laptop, not an OS upgrade). Homebrew installation was fine, all the scripts and bash files are in the correct places, and I created a bash_profile because I didn't have one, and even set my shell to load with Bash Completion folder from the Terminal preferences. Any ideas? Thanks!
Default shell is now zshell and not bash. Update your shell and change it back to bash and you should be good to go.
For terminal: Preferences -> General Shells open with and change to /bin/bash
Iterm: Preferences -> Profiles -> Command -> Custom shell and enter /bin/bash
Thanks, it's been two days that I'm searching for a solution to my autocomplete issue on the Iterm app! 🙏
For those having the same issue on Mac OS Catalina and zsh, here is my simple solution:
It is very likely that you already have the git autocomplete files.
Check it running ls /Library/Developer/CommandLineTools/usr/share/git-core
, you should see something like:
If you don't have it, download it and save it anywhere, I suggest it to be a folder under the home directory like .zshrc
. Then add your folder to your $PATH environment variable.
Then, open (or create) the file ~/.zprofile
and add autoload -Uz compinit && compinit
in the last line.
And now, just close and open your shell again.
I had to add autoload -Uz compinit && compinit
to my ~/.zshrc
instead, but that worked. Thanks @micaelomota!
I'm unclear how I'm supposed to mend this if it's broken on bash and I want to keep using bash. I see that I do have the files @micaelomota listed at /Library/Developer/CommandLineTools/usr/share/git-core
, but I'm unclear what I'm supposed to do with a variable here, or how to modify this if I'm keeping bash. Help please?
@sanscontext if you are keeping bash, the only thing you need to do is to add autoload -Uz compinit && compinit
in your ~/.bashrc
file
@micaelomota Much appreciated, but I think I need to do something more than that. 🤔
This is the topline when I restart Terminal after adding this. -bash: autoload: command not found
If nothing helps, try to remove symlink /usr/local/share/zsh/site-functions/_git
that appears after installation with brew brew install git
Stop working in macOS Catalina