Skip to content

Instantly share code, notes, and snippets.

@WenxiJin
Created September 22, 2016 13:59
Show Gist options
  • Save WenxiJin/b1f36abe247287fcea42bc545e288c09 to your computer and use it in GitHub Desktop.
Save WenxiJin/b1f36abe247287fcea42bc545e288c09 to your computer and use it in GitHub Desktop.
Partial .zshrc script for setting tmux pane title on ssh hostname
ssh() {
if [ "$(ps -p $(ps -p $$ -o ppid=) -o comm=)" = "tmux" ]; then
tmux rename-window "$(echo $* | cut -d . -f 1)"
command ssh "$@"
tmux set-window-option automatic-rename "on" 1>/dev/null
else
command ssh "$@"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment