summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.tmux.conf1
-rw-r--r--.zshrc16
2 files changed, 16 insertions, 1 deletions
diff --git a/.tmux.conf b/.tmux.conf
index 6764e69..43975a5 100644
--- a/.tmux.conf
+++ b/.tmux.conf
@@ -11,6 +11,7 @@ set-option -g history-limit 100000
set-option -g allow-rename on
set-option -g set-titles on
set-option -g set-titles-string "#W"
+set-option -ga update-environment " SSH_CLIENT SSH_TTY"
bind-key r source-file ~/.tmux.conf \; display "Config reloaded!"
bind z run tmux-url-select
diff --git a/.zshrc b/.zshrc
index f6beb89..d5730f6 100644
--- a/.zshrc
+++ b/.zshrc
@@ -112,6 +112,16 @@ function title {
esac
}
+function refresh_tmux {
+ if [ -n "$TMUX" ]; then
+ eval $(tmux showenv -s SSH_CONNECTION)
+ eval $(tmux showenv -s SSH_CLIENT)
+ eval $(tmux showenv -s SSH_TTY)
+ eval $(tmux showenv -s SSH_AUTH_SOCK)
+ eval $(tmux showenv -s DISPLAY)
+ fi
+}
+
function set_title_precmd {
title "%15<..<%~%<<" $ZSH_THEME_TERM_TITLE_IDLE
}
@@ -126,8 +136,12 @@ function set_title_preexec {
title '$CMD' '%100>...>$LINE%<<'
}
+function refresh_preexec {
+ refresh_tmux
+}
+
precmd_functions+=(set_title_precmd)
-preexec_functions+=(set_title_preexec)
+preexec_functions+=(set_title_preexec refresh_preexec)
# zshenv may not be attached to a tty, so we set this here instead
export GPG_TTY="$(tty)"