From ab2c63934e4f6cca6e1b81e8542a7731e8521b37 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Wed, 23 Nov 2016 14:03:31 -0600 Subject: [PATCH] [zsh] renames tmux window during ssh --- zsh/zshrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zsh/zshrc b/zsh/zshrc index a0de3fe..2ac7902 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -74,3 +74,13 @@ man() { LESS_TERMCAP_us=$'\e[1;32m' \ man "$@" } + +ssh() { + if [ "$(ps -p $(ps -p $$ -o ppid=) -o comm=)" = "tmux" ]; then + tmux rename-window "$*" + command ssh "$@" + tmux set-window-option automatic-rename "on" 1>/dev/null + else + command ssh "$@" + fi +}