Amree
Amree

Reputation: 2890

tmux not loading asdf config

I'm having trouble loading the correct version of ruby/node when I create a tmux session. This doesn't happen if I use ruby/node without tmux

$ tmux new-session -s servers
$ which ruby
/usr/bin/ruby

Compared to normal terminal session:

/Users/amree/.asdf/shims/ruby

Related dotfiles:

More information

Upvotes: 3

Views: 961

Answers (1)

Amree
Amree

Reputation: 2890

The actual problem was because of the $PATH has been prepended automatically by /etc/zprofile again when I opened the tmux session.

In order to prevent that, I just disable it when it's in tmux session:

# /etc/zprofile
# system-wide environment settings for zsh(1)
if [ -x /usr/libexec/path_helper ]; then
  if [ -z "$TMUX" ]; then
    eval `/usr/libexec/path_helper -s`
  fi
fi

Upvotes: 4

Related Questions