X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=customizing%2Ffred%2Fscripts%2Fssh.sh;h=39856a897e8713639e4c31dcb51d0635c7b169b9;hb=ab6bacb578744ce2a0132af78fbf5dc461cf00d3;hp=90b0a56721af9421995d3286fd309f41a3d0ff78;hpb=5a7f49c86876037c7c99c12b5e35ae6477f3de2d;p=feisty_meow.git diff --git a/customizing/fred/scripts/ssh.sh b/customizing/fred/scripts/ssh.sh index 90b0a567..39856a89 100755 --- a/customizing/fred/scripts/ssh.sh +++ b/customizing/fred/scripts/ssh.sh @@ -4,8 +4,21 @@ source "$FEISTY_MEOW_GENERATED/custom/scripts/pick_credentials.sh" -# save the former terminal title if we're running in X. -prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')" +# 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.+= \"(.*)\"$/')" +fi + +# force the TERM variable to a more generic version for other side. +# we don't want the remote side still thinking it's running xterm. +export TERM=linux + +#hmmm: it would be good to set an interrupt handler here and +# trap ctrl-c, since otherwise we are getting exited from and losing a chance +# to reset the terminal title. this actually happens a lot, since some X11 +# or other background process is left running and the ssh never actually quits, +# forcing one to hit ctrl-c. if [ ! -z "$keyfile" ]; then \ssh -i "$keyfile" -X -C -c blowfish-cbc $*