Skip to content

Instantly share code, notes, and snippets.

@cocobear
Forked from florianbeer/set-tmux-title
Last active August 8, 2019 02:59
Show Gist options
  • Save cocobear/a98ae0e54ed0e57d9de71a288ea6f5b2 to your computer and use it in GitHub Desktop.
Save cocobear/a98ae0e54ed0e57d9de71a288ea6f5b2 to your computer and use it in GitHub Desktop.
[set tmux title] 设置tmux标题为ssh主机名 #tmux #ssh
ssh() {
if [ "$(ps -p $(ps -p $$ -o ppid=) -o comm=)" = "tmux" ]; then
tmux rename-window "$(echo $*)"
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