Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
zimbatm edited this page Nov 10, 2019 · 4 revisions

It is recommended to wrap tmux to avoid issues with environment loading.

In Bash / ZSH:

alias tmux='direnv exec / tmux'

In Fish:

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.

Alternatively

NOTE: this solution will not revert to the original environment if a direnv-managed folder was entered before invoking tmux.

Rather than aliasing tmux, you can try adding these lines to .tmux.conf or /etc/tmux.conf:

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

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.