From c82fa760e682a979811b20a989e784f36037bdd6 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 17 Jan 2021 23:24:18 +0000 Subject: [PATCH] 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. --- zsh/lib/tmux.zsh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 zsh/lib/tmux.zsh 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 -- 2.48.1