From 2f5f0147ce2a06813e4fee82bd771ebf8c8a73ee Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sat, 17 Sep 2016 18:43:48 -0400 Subject: [PATCH] ha, fixed the terminal title not getting reused. the terminal isn't always just xterm now. --- customizing/fred/scripts/ssh.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/customizing/fred/scripts/ssh.sh b/customizing/fred/scripts/ssh.sh index 4d006037..85ef9f52 100644 --- a/customizing/fred/scripts/ssh.sh +++ b/customizing/fred/scripts/ssh.sh @@ -8,7 +8,7 @@ source "$FEISTY_MEOW_LOADING_DOCK/custom/scripts/pick_credentials.sh" prior_title= which xprop &>/dev/null if [ $? -eq 0 ]; then - if [ "$TERM" == "xterm" ]; then + if [[ "$TERM" =~ .*"xterm".* ]]; then prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')" fi fi @@ -37,8 +37,10 @@ if [ $? -eq 0 ]; then # re-run the terminal labeller after coming back from ssh. # we check the exit value because we don't want to update this for a failed connection. if [ -z "$prior_title" ]; then +echo prior title nil new label bash $FEISTY_MEOW_SCRIPTS/tty/label_terminal_with_infos.sh else +echo "using old prior title of '$prior_title'" bash $FEISTY_MEOW_SCRIPTS/tty/set_term_title.sh "$prior_title" fi fi -- 2.34.1