From fcff8030dcf554e914aaf18c2c3eacf28e8e2227 Mon Sep 17 00:00:00 2001 From: hanez Date: Wed, 23 Jul 2025 02:18:15 +0200 Subject: [PATCH] zsh --- .zsh/functions.d/aliases.sh | 2 ++ .zsh/functions.d/s.sh | 22 ---------------------- .zsh/functions.d/us.sh | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.zsh/functions.d/aliases.sh b/.zsh/functions.d/aliases.sh index 49da586d..79e97c5a 100644 --- a/.zsh/functions.d/aliases.sh +++ b/.zsh/functions.d/aliases.sh @@ -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 diff --git a/.zsh/functions.d/s.sh b/.zsh/functions.d/s.sh index c5acccdb..14a13030 100644 --- a/.zsh/functions.d/s.sh +++ b/.zsh/functions.d/s.sh @@ -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 -} - diff --git a/.zsh/functions.d/us.sh b/.zsh/functions.d/us.sh index a64709c9..a33841ff 100644 --- a/.zsh/functions.d/us.sh +++ b/.zsh/functions.d/us.sh @@ -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 "$@"