Skip to content

Trying to understand if brew shellenv is doing the right thing with zsh site-functions #5683

Closed Answered by carlocab
alichaudry asked this question in Everyday usage
Discussion options

You must be logged in to vote

The output of /bin/ps -p $PPID -c -o comm= when run directly in your terminal is not the same as what brew shellenv sees (your terminal and brew shellenv have different parent processes).

Can you try applying this patch to $(brew --repository)/Library/Homebrew/cmd/shellenv.sh

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}" ]] &&
      [[ "${HOM…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@alichaudry
Comment options

Answer selected by alichaudry
Comment options

You must be logged in to vote
2 replies
@alichaudry
Comment options

@phaseOne
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants