Save PID of SSH connection

This commit is contained in:
Thomas Avé 2023-09-17 20:54:52 +02:00
parent ee4ab9e302
commit d7263b8c51
1 changed files with 5 additions and 0 deletions

View File

@ -167,6 +167,11 @@ function o () {
xdg-open "$1" &! xdg-open "$1" &!
} }
if [ "$SSH_CLIENT" ]
then
source_port=$(echo $SSH_CLIENT | awk '{ print $2 }')
echo $$ > /tmp/ssh_session_$source_port
fi
if [[ "$TERM" == (Eterm*|alacritty*|aterm*|gnome*|konsole*|kterm*|putty*|rxvt*|screen*|tmux*|xterm*) ]]; then if [[ "$TERM" == (Eterm*|alacritty*|aterm*|gnome*|konsole*|kterm*|putty*|rxvt*|screen*|tmux*|xterm*) ]]; then
add-zsh-hook -Uz precmd xterm_title_precmd add-zsh-hook -Uz precmd xterm_title_precmd