-1

for example, when i start terminal and type brew install spot

and press TAB - nothing, only dir like a Desktop/, but when i exec zsh everything magically starts working

finegorko
  • 57
  • 8
  • Does completion work after entering `autoload -Uz compinit && compinit` in a new terminal window? – Gairfowl Jun 28 '22 at 21:47
  • no :( check this [video](https://imgur.com/a/zeONMBq) – finegorko Jun 28 '22 at 22:34
  • Another thing to try: source the .zshrc file a second time (the first time happens when you log in): `. ~/.zshrc`. – Gairfowl Jun 28 '22 at 23:33
  • it doesn't work :( – finegorko Jun 29 '22 at 08:26
  • I'm afraid I am out of simple things to try. You may need to rebuild the various [dot files](https://zsh.sourceforge.io/Doc/Release/Files.html#Files) one item at a time try to isolate the issue. The symptoms you are reporting seem to be related to `compinit`; the call to `compinit` may be buried somewhere in the `oh-my-zsh` code. – Gairfowl Jun 29 '22 at 17:33
  • [fix](https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh) – finegorko Jun 30 '22 at 22:53
  • Cool - glad you found it. That may be something you could type up as an answer here to help the next person who comes across it. – Gairfowl Jul 01 '22 at 15:45

1 Answers1

-1

Add it to your .zshrc:

if type brew &>/dev/null
    then
      FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
    
      autoload -Uz compinit
      compinit
    fi
finegorko
  • 57
  • 8