X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=customizing%2Ffred%2Fscripts%2Fssh.sh;h=316228c1f01ad16f8ba88b9cfddb3d98aa9db324;hb=22bbd7c6d7bbb09a5ba955d30ceebf93693d23fb;hp=13d57fa3cfceea4126362bc2ef8bdec961fcc7df;hpb=1874b84e75a13d5959f4713734ff40dcc5d37581;p=feisty_meow.git diff --git a/customizing/fred/scripts/ssh.sh b/customizing/fred/scripts/ssh.sh index 13d57fa3..316228c1 100644 --- a/customizing/fred/scripts/ssh.sh +++ b/customizing/fred/scripts/ssh.sh @@ -6,8 +6,11 @@ source "$FEISTY_MEOW_LOADING_DOCK/custom/scripts/pick_credentials.sh" # save the former terminal title if we're running in X with xterm. prior_title= -if [ "$TERM" == "xterm" ]; then - prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')" +which xprop &>/dev/null +if [ $? -eq 0 ]; then + if [[ "$TERM" =~ .*"xterm".* ]]; then + prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')" + fi fi # force the TERM variable to a more generic version for other side. @@ -34,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