Trying to understand if brew shellenv
is doing the right thing with zsh site-functions
#5683
Replies: 2 comments
-
The output of Can you try applying this patch to diff --git a/Library/Homebrew/cmd/shellenv.sh b/Library/Homebrew/cmd/shellenv.sh
index 498510ac44..d729c75be6 100644
--- a/Library/Homebrew/cmd/shellenv.sh
+++ b/Library/Homebrew/cmd/shellenv.sh
@@ -17,6 +17,7 @@ homebrew-shellenv() {
else
HOMEBREW_SHELL_NAME="$(/bin/ps -p "${PPID}" -c -o comm=)"
fi
+ echo "HOMEBREW_SHELL_NAME=${HOMEBREW_SHELL_NAME}"
if [[ -n "${HOMEBREW_MACOS}" ]] &&
[[ "${HOMEBREW_MACOS_VERSION_NUMERIC}" -ge "140000" ]] && and then tell me the output of You can do git -C "$(brew --repository)" restore Library/Homebrew/cmd/shellenv.sh after to undo the changes. |
Beta Was this translation helpful? Give feedback.
-
Your frustration may be from the slight non-synchronisation between documentation and implementation, as pointed out by Homebrew/brew#18579. While the " This is an acknowledged issue, and since you're following the stable releases, one option for you would be to wait until the next stable release (which, following Homebrew's typical release cycle, should take place early next week). Alternatively, you can get the latest updates (though not officially considered stable yet) by first switching on the developer mode with |
Beta Was this translation helpful? Give feedback.
-
Output of
brew config
Output of
brew doctor
Description of issue
I was trying to understand why zsh autocompletion wasn't working for me when I noticed that, unless I'm missing something (which may very well be the case), the
shellenv
logic doesn't really work as intended. Specifically, I see that this logic relies onHOMEBREW_SHELL_NAME
beingzsh
. However,HOMEBREW_SHELL_NAME
comes from here which for me is always resolving tologin
:Since it's returning
login
, this wouldn't matchzsh
, and therefore never add${HOMEBREW_PREFIX}/share/zsh/site-functions
to myfpath
, right? I can confirm that the line isn't appending anything to my fpath:Or maybe I'm thinking about this all wrong and
HOMEBREW_SHELL_NAME
comes from here, but if I'm reading this right this would always be null as my~/.zprofile
readseval "$(/opt/homebrew/bin/brew shellenv)"
, and there's no args being passed toshellenv
.I'd appreciate any insight here.
Beta Was this translation helpful? Give feedback.
All reactions