Compare commits

...

3 Commits

Author SHA1 Message Date
Thomas Avé 1094608c76 Merge branch 'master' into laptop 2023-09-17 21:08:07 +02:00
Thomas Avé 741d0f4d1e Escape paths to allow for spaces 2023-09-17 21:08:00 +02:00
Thomas Avé d7263b8c51 Save PID of SSH connection 2023-09-17 20:55:14 +02:00
2 changed files with 6 additions and 1 deletions

View File

@ -10,7 +10,7 @@ then
if [ $PROCESS == "ssh" ]
then
PORT=$(ss -tnpa | grep ssh | grep "pid=$GRAND_CHILD_PID" | awk '{ print $4 }' | grep -o '[0-9]*$')
alacritty -e $COMMAND -t "cd \$(readlink -e /proc/\$(cat /tmp/ssh_session_$PORT)/cwd); zsh --login"
alacritty -e $COMMAND -t "cd \"\$(readlink -e /proc/\$(cat /tmp/ssh_session_$PORT)/cwd)\"; zsh --login"
exit 0
fi
fi

View File

@ -167,6 +167,11 @@ function o () {
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
add-zsh-hook -Uz precmd xterm_title_precmd