2021-08-22 15:37:15 +05:00
|
|
|
# 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
|
2022-02-14 23:10:34 +05:00
|
|
|
tmux -2u rename-window "ssh $(echo $* | rev | cut -d '@' -f1 | rev)"
|
|
|
|
command ssh "$@"
|
|
|
|
tmux -2u set-window-option automatic-rename "on" > /dev/null
|
2021-08-22 15:37:15 +05:00
|
|
|
else
|
|
|
|
command ssh "$@";
|
|
|
|
fi
|
|
|
|
}
|