【问题标题】:asdf command no longer works inside tmux sessionasdf 命令不再在 tmux 会话中工作
【发布时间】:2022-01-17 22:38:13
【问题描述】:

升级到 osx Monterey 并更新 brew 后,asdf 命令在 tmux 会话中停止工作。我只使用 asdf 来管理 Node.js 和 Elixir 版本。

$asdf

未知命令:asdf /usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf:第 82 行:/usr/local/opt/asdf/lib/commands/command-help.bash:没有这样的文件或目录

当我运行 tmux 会话时,asdf 命令会产生上述错误。但是,当我不使用 tmux 时,asdf 命令可以正常运行。

当我从 tmux 会话运行 which asdf 时,我应该得到一个 asdf 可执行文件的路径。相反,我得到了这个:

$ which asdf
asdf () {
        local command
        command="$1"
        if [ "$#" -gt 0 ]
        then
                shift
        fi
        case "$command" in
                ("shell") eval "$(asdf export-shell-version sh "$@")" ;;
                (*) command asdf "$command" "$@" ;;
        esac
}

【问题讨论】:

    标签: tmux asdf


    【解决方案1】:

    解决此问题的方法是使用 brew 卸载 asdf:

    brew uninstall asdf

    然后,使用建议的基于 git 的安装而不是 brew:

    git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1

    在 tmux 会话中运行 asdf 时,基于 brew 的安装似乎会导致问题。我不确定这实际上是 osx Monterey 问题,还是仅仅是使用 brew 更新到最新版本的 asdf 的问题。无论如何,这是让 asdf 再次在您的 tmux 会话中工作的方法。

    【讨论】:

    猜你喜欢
    • 2012-01-21
    • 2021-03-08
    • 2021-10-09
    • 1970-01-01
    • 2018-11-26
    • 1970-01-01
    • 1970-01-01
    • 2014-12-27
    • 1970-01-01
    相关资源
    最近更新 更多