This commit is contained in:
Johannes Findeisen 2025-07-23 01:53:01 +02:00
commit 675bd7c857
2 changed files with 24 additions and 2 deletions

View file

@ -19,8 +19,29 @@ s() {
# Run SSH session
command ssh "$@"
# Restore after disconnect
printf '\033k%s\033\\' "$original_name"
# Restore previous tmux window name
tmux rename-window "$original_name"
else
command ssh "$@"
fi
}
sshr() {
if [ -n "$TMUX" ]; then
local original_name
original_name=$(tmux display-message -p '#W')
local ssh_host="$1"
ssh_host="${ssh_host#*@}"
ssh_host="${ssh_host%%:*}"
ssh_host="${ssh_host%% *}"
# Emit title update BEFORE ssh
printf '\033k%s\033\\' "${ssh_host%%.*}"
command ssh "$@"
else
command ssh "$@"
fi

1
.zshrc
View file

@ -2,6 +2,7 @@
source ~/.env
# Source some private stuff or custom things that are different on my systems.
# This file is not in the Git repository!
source ~/.penv
# Do some exports!