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

Path doesn't respect order #337

Closed
paradox460 opened this issue Dec 9, 2012 · 7 comments
Closed

Path doesn't respect order #337

paradox460 opened this issue Dec 9, 2012 · 7 comments

Comments

@paradox460
Copy link
Contributor

I've got another interesting conundrum.

I've got a customized path in my .zshenv, pretty much the standard one, just rearranged slightly:

path=(
  /usr/local/{bin,sbin}
  /usr/{bin,sbin}
  /{bin,sbin}
  ~/.bin
  $path
)

But if i run echo ${PATH} in a new terminal, I get /Users/jeffs/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/sbin:/Users/jeffs/.bin

As you can see, the /usr/local is appearing later in the path than the /usr/bin. Homebrew tends to whine about this, as it should, as system binaries could override homebrew binaries this way.

Interestingly enough, though, if i run exec $SHELL and then run echo ${PATH}, i get /Users/jeffs/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/jeffs/.bin:/opt/X11/bin:/Users/jeffs/.rbenv/shims, which is correct.

@paradox460
Copy link
Contributor Author

I forgot to sudo chmod ugo-x /usr/libexec/path_helper on my new system. I feel like an idiot.

@fuadsaud
Copy link

fuadsaud commented Jan 7, 2014

Sorry, I have the same problem.I'm having the same problem. I'm running zsh inside tmux.

~/C/prezto ruby:2.0.0-p195 git:master ❯❯❯ cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

~/.zshenv:

# Set the list of directories that Zsh searches for programs.
path=(
  $path
  ~/.jarvis/bin
  ~/.go/bin
  /usr/local/share/npm/bin
  /usr/local/heroku/bin
  /usr/local/{bin,sbin}
)

~/.zshrc:

export PATH="./bin:$PATH"
~/C/prezto ruby:2.0.0-p195 git:master ❯❯❯ print -l $path
./bin
/Users/fuad/.rbenv/shims
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Users/fuad/.jarvis/bin
/Users/fuad/.go/bin
/usr/local/share/npm/bin
/usr/local/heroku/bin
/usr/local/sbin

@pablox-cl
Copy link

A lot of stuff has been moved between .zprofileand .zhenv. Are you sure you are using the latest versions?

@fuadsaud
Copy link

fuadsaud commented Jan 8, 2014

I update my dotfiles; problem continues.

@fuadsaud
Copy link

fuadsaud commented Jan 8, 2014

Printing out the path right after setting it on .zprofile outputs the expected result.

@pablox-cl
Copy link

That was the reason issue #500 existed ;)

@fuadsaud
Copy link

I see, thanks for the link. I thought I had path_helper disabled, but I didn't; that did the trick

kodelint pushed a commit to kodelint/prezto that referenced this issue Nov 15, 2016
kodelint pushed a commit to kodelint/prezto that referenced this issue Nov 15, 2016
…efined value.

Causes such expansions to be highlighted as [unknown-token] rather than as default (absent from $region_highlight).

Fixes sorin-ionescu#337.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants