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
|
# Run SSH session
|
||||||
command ssh "$@"
|
command ssh "$@"
|
||||||
|
|
||||||
# Restore after disconnect
|
# Restore previous tmux window name
|
||||||
printf '\033k%s\033\\' "$original_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
|
else
|
||||||
command ssh "$@"
|
command ssh "$@"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
1
.zshrc
1
.zshrc
|
|
@ -2,6 +2,7 @@
|
||||||
source ~/.env
|
source ~/.env
|
||||||
|
|
||||||
# Source some private stuff or custom things that are different on my systems.
|
# Source some private stuff or custom things that are different on my systems.
|
||||||
|
# This file is not in the Git repository!
|
||||||
source ~/.penv
|
source ~/.penv
|
||||||
|
|
||||||
# Do some exports!
|
# Do some exports!
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue