This commit is contained in:
2024-06-21 18:40:01 +02:00
parent 90b5a8ad61
commit 6e63a19f04
2 changed files with 11 additions and 5 deletions

View File

@@ -1,11 +1,16 @@
if [ "$PRESERVE_SSH_CWD" = "true" ]; then
if [ -z $TERMINAL_UUID ]; then
if [ -z $DISPLAY ]; then
if [ -z $DISPLAY ]; then
if [ -z $TERMINAL_UUID ]; then
export TERMINAL_UUID=$(uuidgen)
else
WINDOW_ID=$(xdotool getactivewindow)
fi
else
WINDOW_ID=$(xdotool getactivewindow)
if [ $? -eq 0 ]; then
WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2)
export TERMINAL_UUID=$WM_NAME
else
export TERMINAL_UUID=$(uuidgen)
fi
fi
echo -en "\e]2;$TERMINAL_UUID\a"