【问题标题】:tmux not loading asdf configtmux 未加载 asdf 配置
【发布时间】:2018-08-05 10:52:51
【问题描述】:

我在创建 tmux 会话时无法加载正确版本的 ruby​​/node。如果我使用没有 tmux 的 ruby​​/node 就不会发生这种情况

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

与普通终端会话相比:

/Users/amree/.asdf/shims/ruby

相关点文件:

更多信息

  • 它运行相同的外壳(有和没有tmux)。我通过运行echo $SHELL 确认了这一点
  • 注释掉整个 tmux 配置文件没有帮助

【问题讨论】:

  • tmux 加载bash 还是zsh?当您打开终端与 tmux 时,是否正在加载不同的 shell?
  • 如果你在没有任何配置(通过移动 tmux.conf 和相关文件)的情况下从 tmux 加载路径加载 tmux 会发生什么?
  • tmux 正在加载 zsh。通过运行echo $SHELL 并根据其外观确认。这是在没有 tmux 的情况下运行的相同 shell
  • @alpha_989 我注释掉了.tmux.conf 中的所有内容,它仍在加载zsh,问题仍然存在(未正确加载正确的ruby 或节点版本)

标签: tmux oh-my-zsh asdf-vm


【解决方案1】:

实际问题是因为$PATH 在我打开tmux 会话时再次被/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

【讨论】:

    猜你喜欢
    • 2022-01-17
    • 1970-01-01
    • 2019-10-22
    • 2015-06-06
    • 2012-03-26
    • 2022-07-24
    • 2012-06-30
    • 2018-03-04
    • 1970-01-01
    相关资源
    最近更新 更多