Add ssh wrapper which able to set local TMUX window name without crutches on remote side.
This commit is contained in:
parent
14d6126c4c
commit
f4bf8402b2
11
zsh/aliases/50-ssh.conf
Normal file
11
zsh/aliases/50-ssh.conf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Found at https://www.reddit.com/r/tmux/comments/nyjjwy/add_hostname_of_remote_server_in_status_bar/
|
||||||
|
# and modified to set also "ssh" prefix.
|
||||||
|
ssh() {
|
||||||
|
if [ -n "$TMUX" ]; then
|
||||||
|
tmux -2u rename-window "ssh $(echo $* | rev | cut -d '@' -f1 | rev)";
|
||||||
|
command ssh "$@";
|
||||||
|
tmux -2u set-window-option automatic-rename "on" > /dev/null;
|
||||||
|
else
|
||||||
|
command ssh "$@";
|
||||||
|
fi
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user