Merge branch 'master' into laptop

This commit is contained in:
Thomas Avé 2023-09-17 21:08:07 +02:00
commit 1094608c76
2 changed files with 6 additions and 1 deletions

View File

@ -10,7 +10,7 @@ then
if [ $PROCESS == "ssh" ] if [ $PROCESS == "ssh" ]
then then
PORT=$(ss -tnpa | grep ssh | grep "pid=$GRAND_CHILD_PID" | awk '{ print $4 }' | grep -o '[0-9]*$') 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 exit 0
fi fi
fi fi

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