[zsh] renames tmux window during ssh
This commit is contained in:
parent
53e6e6d9bd
commit
ab2c63934e
1 changed files with 10 additions and 0 deletions
10
zsh/zshrc
10
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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue