1

After upgrading to osx Monterey and updating brew, the asdf command stopped working inside a tmux session. I'm only using asdf to manage Node.js and Elixir versions.

$ asdf

Unknown command: asdf /usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf: line 82: /usr/local/opt/asdf/lib/commands/command-help.bash: No such file or directory

When I run a tmux session, the asdf command produces the error above. However, the asdf command runs correctly when I don't use tmux.

When I run which asdf from a tmux session, I should get a path to the asdf executable. Instead I get this:

$ 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
}

2 Answers2

2

After opening an issue on the HomeBrew repo, Tmux no longer works with asdf. The problem was: "a cache invalidation problem." I was able to resolve this issue by killing all tmux sessions, as recommended by the one of the helpful #homebrew

tmux kill-server

This resolved the problem.

diek
  • 657
  • 7
  • 16
1

The fix for this issue was to Uninstall asdf with brew:

brew uninstall asdf

Then, use the suggested git based installation instead of brew:

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

It looks like the brew based installation causes problems when running asdf inside a tmux session. Im not sure if this is in fact a osx Monterey issue, or simply an issue of using brew to update to the latest version of asdf. Regardless, this is how to get asdf working inside your tmux sessions again.