From: Samir Benmendil Date: Sun, 17 Jan 2021 23:24:18 +0000 (+0000) Subject: tmux: update env variables when attaching a tmux session X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/c82fa760e682a979811b20a989e784f36037bdd6 tmux: update env variables when attaching a tmux session The main reason is to update SSH_AUTH_SOCK to support the new forwarded ssh agent. --- diff --git a/zsh/lib/tmux.zsh b/zsh/lib/tmux.zsh new file mode 100644 index 0000000..296f428 --- /dev/null +++ b/zsh/lib/tmux.zsh @@ -0,0 +1,7 @@ +if [[ -n "$TMUX" ]]; then + function update-env { + # update environment from tmux + eval $(tmux show-environment -s) + } + preexec_functions+=(update-env) +fi