This commit is contained in:
Johannes Findeisen 2025-07-23 02:18:15 +02:00
commit fcff8030dc
3 changed files with 3 additions and 23 deletions

View file

@ -22,6 +22,8 @@ alias lla='ls -la --color'
alias llh='ls -lh --color'
alias llah='ls -lah --color'
alias su='us -'
alias n='nnn -diUxe'
alias vi=vim

View file

@ -23,25 +23,3 @@ s() {
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 "$@"
# Restore after disconnect
printf '\033k%s\033\\' "$original_name"
else
command ssh "$@"
fi
}

View file

@ -11,7 +11,7 @@ us() {
fi
# Rename the window before running su
tmux rename-window "su-${target_user}"
tmux rename-window "su(${target_user})"
# Use "command su" to bypass the function if it exists
command su "$@"