zsh
This commit is contained in:
parent
57cea86f52
commit
675bd7c857
2 changed files with 24 additions and 2 deletions
|
|
@ -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
1
.zshrc
|
|
@ -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!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue