Laptop #2
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue