+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=
+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.
+# 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.