Compare commits

..

No commits in common. "209c9fe5c83941dbc844c2140e65ece82710e73c" and "2bb2b12817d8ac2350c2fed8d970cdc9650a7b87" have entirely different histories.

1 changed files with 0 additions and 13 deletions

View File

@ -1,19 +1,6 @@
#!/bin/bash
CHILD_PID=$(pgrep -P $1)
GRAND_CHILD_PID=$(pgrep -P $CHILD_PID)
if [ $? == 0 ]
then
PROCESS=$(ps -p $GRAND_CHILD_PID -o comm=)
COMMAND=$(ps -p $GRAND_CHILD_PID -o args --no-headers)
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"
exit 0
fi
fi
pushd "/proc/$CHILD_PID/cwd"
SHELL_CWD=$(pwd -P)