Homebrew/brew.sh

Incorrect zsh completions instructions

Undre4m opened this issue · 1 comments

Instructions under Configuring Completions in zsh correctly prompt users to load zsh/site-functions path into FPATH and calling compinit at ~/.zshrc.
image

However, for Oh My Zsh users, since completions are automatically initialized by OMZ (when sourcing oh-my-zsh.sh), users are INSTEAD instructed to update FPATH at ~/.zprofile as to make completions available before compinit is called.
image

This won't work on non-login shells, as $ZDOTDIR/.zprofile is only sourced for login shells by default: Zsh Startup/Shutdown Files

Commands are then read from $ZDOTDIR/.zshenv. If the shell is a login shell, commands are read from /etc/zprofile and then $ZDOTDIR/.zprofile. Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc.

For completions to work for non-login interactive Zshells FPATH should be updated at $ZDOTDIR/.zshrc, before OMZ is initialized (source $ZSH/oh-my-zsh.sh). Instructions should be corrected to reflect this. Install script Next steps instructions should also be corrected.

Can you submit a pull request to https://github.com/Homebrew/brew/tree/master/docs to make your requested changes? Thanks!