Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
It is recommended to wrap tmux to avoid issues with environment loading.
In Bash / ZSH:
alias tmux='direnv exec / tmux'
alias tmux "direnv exec / tmux"
This will make sure that direnv is unloaded before executing tmux, and avoid issues with environment variables mangling in tmux's subshells.
Rather than aliasing tmux, you can try adding these lines to
set-option -g update-environment "DIRENV_DIFF DIRENV_DIR DIRENV_WATCHES" set-environment -gu DIRENV_DIFF set-environment -gu DIRENV_DIR set-environment -gu DIRENV_WATCHES set-environment -gu DIRENV_LAYOUT