updated asdf from <= 0.4.1 to 0.4.2
$ echo $PATH | tr ':' '\n'
/Users/me/.asdf/bin
/Users/me/.asdf/shims
/usr/local/bin
$ echo $PATH | tr ':' '\n'
/usr/local/bin
/Users/me/.asdf/bin
/Users/me/.asdf/shims
OS: Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jan 11 22:59:40 PST 2018; root:xnu-3789.73.8~1/RELEASE_X86_64 x86_64 i386 MacBookPro14,3 Darwin
asdf version: 0.4.2
can confirm, for now I had to manually alter PATH
Likely introduced by #271.
I'm unsure why this would be caused by #271 though, it appears to still be adding asdf to the beginning of PATH.
I can't reproduce, Ubuntu 17.10 seems fine
asdf version: 0.4.1
/home/james/.local/bin
/home/james/.asdf/bin
/home/james/.asdf/shims
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/games
/usr/local/games
/snap/bin
/opt/yarn-[version]/bin
/home/james/.asdf/installs/nodejs/8.9.4/.npm/bin
/home/james/.fzf/bin
then ran asdf update and reloaded shell.
asdf version: 0.4.2
/home/james/.local/bin
/home/james/.asdf/shims
/home/james/.asdf/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/games
/usr/local/games
/snap/bin
/opt/yarn-[version]/bin
/home/james/.asdf/installs/nodejs/8.9.4/.npm/bin
/home/james/.fzf/bin
You are right @jthegedus. @akatov are you sure nothing else is modifying your path after asdf.sh is run? asdf will only add itself to the beginning of your path at the time it's run. If there is other code that runs later and adds stuff to the beginning of the path asdf will no longer be the first thing in the list of paths.
Going to close this now since I am unable to reproduce this and the code is definitely adding asdf to the beginning of the path.
@akatov Any chance you're using tmux? I'm seeing asdf at the beginning of my PATH until I launch tmux, then it's somehow bumped to the end. Not sure if related.
Outside of tmux:
❯ echo $PATH | tr : "\n"
/Users/adammccrea/.asdf/shims
/Users/adammccrea/.asdf/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
Within tmux:
❯ echo $PATH | tr : "\n"
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Users/adammccrea/.asdf/shims
/Users/adammccrea/.asdf/bin
This is on macOS 10.13.3, zsh 5.4.2, asdf 0.4.2.
I'm currently working around this by wrapping the path_helper call in /etc/zprofile to ensure tmux isn't running.
# system-wide environment settings for zsh(1)
if [[ -z $TMUX ]]; then
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
fi

Again, this might be totally unrelated to the OP's issue. Just posting my workaround in case someone else stumbles upon this.
I have the same issue w/ zsh & tmux on OSX. Reverting back to 0.4.1 fixed for me
When I made the checks in #271 I specifically noted that I had previously experienced other applications modifying my path https://github.com/asdf-vm/asdf/pull/271#discussion_r161372558
I expected this problem was unrelated to asdf-vm - maybe I was wrong :sweat_smile:
@adamlogic yes sorry, forgot to mention that I'm using tmux + zsh
So I'm using tmux + zsh on OSX 10.13 and I have not experienced this issue, so I'm guess it's the combination of tmux + zsh + something else. We need to pin down what is tripping up asdf.
@Stratus3D Would you share any zsh-related config you have in /etc? That's what I had to hack around to get this working, and I wonder if that's where our differences are.
❯ tail -n +1 /etc/z*
==> /etc/zprofile <==
# system-wide environment settings for zsh(1)
if [[ -z $TMUX ]]; then
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
fi
==> /etc/zshrc <==
# Correctly display UTF-8 with combining characters.
if [ "$TERM_PROGRAM" = "Apple_Terminal" ]; then
setopt combiningchars
fi
disable log
[ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
(I added the tmux check in /etc/zprofile)
Here's mine if it helps
--> tail -n +1 /etc/z*
==> /etc/zprofile <==
# system-wide environment settings for zsh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
==> /etc/zshrc <==
# system-wide environment settings for zsh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
There's a good discussion of this issue at Thoughtbot's dotfiles: https://github.com/thoughtbot/dotfiles/issues/587
For what it's worth, I'm using tmux + zsh, and I worked around this issue by manually manipulating my PATH in zshrc.local (which is sourced by ~/.zshrc — a convention in Thoughtbot's dotfiles):
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
export PATH="${ASDF_DIR}/bin:${ASDF_DIR}/shims:$PATH"
And my path inside tmux + zsh is now as follows:
% echo $PATH | tr ':' '\n'
/Users/gohanlon/.asdf/bin
/Users/gohanlon/.asdf/shims
.git/safe/../../bin
/Users/gohanlon/.bin
/usr/local/sbin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/opt/X11/bin
@gohanlon That is indeed a good discussion, I recommend everyone ending up here read that thread, specifically this comment https://github.com/thoughtbot/dotfiles/issues/587#issuecomment-369335238 .
It seems this issue is exclusive to macOS/OSX. @Stratus3D are you able to reproduce using a Tmux login shell?
For those who can reproduce the problem, please test #303
The problem of not adding asdf to the front of PATH if asdf is already in PATH but not first, should be fixed by this.
Should anything reorder PATH after asdf.sh is run, then there's not much we can do about it here.
Thanks! I verified that #303 fixed my PATH issues with tmux.