]> git.rmz.io Git - dotfiles.git/blobdiff - zsh/lib/tmux.zsh
tmux: update env variables when attaching a tmux session
[dotfiles.git] / zsh / lib / tmux.zsh
diff --git a/zsh/lib/tmux.zsh b/zsh/lib/tmux.zsh
new file mode 100644 (file)
index 0000000..296f428
--- /dev/null
@@ -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