Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with env variables ($path variable) #2035

Open
abelevcov-bricklane opened this issue Feb 24, 2023 · 0 comments
Open

Issue with env variables ($path variable) #2035

abelevcov-bricklane opened this issue Feb 24, 2023 · 0 comments

Comments

@abelevcov-bricklane
Copy link

abelevcov-bricklane commented Feb 24, 2023

Description

After install everything on my MacBook Pro, I've lost HOMEBREW_PREFIX in environment variables and some tools i've lost, cause the $PATH var has been broken

Expected behavior

With commented part in .zprofile I've got correct behaviour

# path=(
#  $HOME/{,s}bin(N)
#  /opt/{homebrew,local}/{,s}bin(N)
#  /usr/local/{,s}bin(N)
#  $path
# )
+/Users/user_name/.zshrc:14> test -f /opt/homebrew/bin/brew
+/Users/user_name/.zshrc:14> /opt/homebrew/bin/brew shellenv
+/Users/user_name/.zshrc:14> eval $'export HOMEBREW_PREFIX="/opt/homebrew";\nexport HOMEBREW_CELLAR="/opt/homebrew/Cellar";\nexport HOMEBREW_REPOSITORY="/opt/homebrew";\nexport PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}";\nexport MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:";\nexport INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}";'
+(eval):1> export HOMEBREW_PREFIX=/opt/homebrew
+(eval):2> export HOMEBREW_CELLAR=/opt/homebrew/Cellar
+(eval):3> export HOMEBREW_REPOSITORY=/opt/homebrew
+(eval):4> export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Applications/Wireshark.app/Contents/MacOS:/Users/user_name/.fig/bin:/Users/user_name/.local/bin
+(eval):5> export MANPATH=/opt/homebrew/share/man::
+(eval):6> export INFOPATH=/opt/homebrew/share/info:

Actual behavior

with enabled debug set -x in my .zshrc and everything in place I'm getting following output:

+/Users/user_name/.zshrc:14> test -f /opt/homebrew/bin/brew
+/Users/user_name/.zshrc:14> /opt/homebrew/bin/brew shellenv
+/Users/user_name/.zshrc:14> eval ''
+/Users/user_name/.zshrc:16> echo

/opt/homebrew/bin/brew shellenv doesn't return anything to my environment

After some investigation, I've realised that the problem in file .zprofile in the following part:

path=(
  $HOME/{,s}bin(N)
  /opt/{homebrew,local}/{,s}bin(N)
  /usr/local/{,s}bin(N)
  $path
)

Steps to Reproduce

  1. Install prezto
  2. add set +x to .zshrc
  3. run env | grep HOMEBREW | sort

Versions

  • Prezto commit: master (fc444f5)
  • ZSH version: zsh 5.8.1 (x86_64-apple-darwin22.0)
  • OS information: MacOS 13.2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant