improvement for the setting back to previous window title, where we now check that...
authorChris Koeritz <fred@gruntose.com>
Mon, 23 Mar 2015 14:57:12 +0000 (10:57 -0400)
committerChris Koeritz <fred@gruntose.com>
Mon, 23 Mar 2015 14:57:12 +0000 (10:57 -0400)
customizing/fred/scripts/ssh.sh

index 90b0a56721af9421995d3286fd309f41a3d0ff78..660071ec7e620dc2b3814062c09b457f9cad5bf6 100755 (executable)
@@ -5,7 +5,10 @@
 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.+= \"(.*)\"$/')"
+prior_title=
+if [ ! -z "$DISPLAY" ]; then
+  prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')"
+fi
 
 if [ ! -z "$keyfile" ]; then
   \ssh -i "$keyfile" -X -C -c blowfish-cbc $*