tmux 不加载 asdf 配置
tmux not loading asdf config
我在创建 tmux 会话时无法加载 ruby/node 的正确版本。如果我在没有 tmux
的情况下使用 ruby/node,则不会发生这种情况
$ tmux new-session -s servers
$ which ruby
/usr/bin/ruby
与普通终端会话相比:
/Users/amree/.asdf/shims/ruby
相关点文件:
- https://github.com/amree/dotfiles/blob/master/tmux.conf
- https://github.com/amree/dotfiles/blob/master/zshrc
更多信息
- 运行 相同 shell(有和没有
tmux
)。我通过 运行 echo $SHELL
确认了
- 注释掉整个
tmux
配置文件没有帮助
实际问题是因为当我打开 tmux 会话时 $PATH
又被 /etc/zprofile
自动添加了前缀。
为了防止这种情况,我只是在 tmux 会话中禁用它:
# /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
我在创建 tmux 会话时无法加载 ruby/node 的正确版本。如果我在没有 tmux
的情况下使用 ruby/node,则不会发生这种情况$ tmux new-session -s servers
$ which ruby
/usr/bin/ruby
与普通终端会话相比:
/Users/amree/.asdf/shims/ruby
相关点文件:
- https://github.com/amree/dotfiles/blob/master/tmux.conf
- https://github.com/amree/dotfiles/blob/master/zshrc
更多信息
- 运行 相同 shell(有和没有
tmux
)。我通过 运行echo $SHELL
确认了
- 注释掉整个
tmux
配置文件没有帮助
实际问题是因为当我打开 tmux 会话时 $PATH
又被 /etc/zprofile
自动添加了前缀。
为了防止这种情况,我只是在 tmux 会话中禁用它:
# /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