dropping this for now; should use syncthing.
[feisty_meow.git] / scripts / tty / label_terminal_with_infos.sh
index 91c1312038505592c853f2c5160263923a89d799..291eafd48544a1b5d8442f301caf15119386fbd9 100644 (file)
@@ -5,15 +5,23 @@
 
 source $FEISTY_MEOW_SCRIPTS/core/functions.sh
 
-pruned_host=$(echo $HOSTNAME | sed -e 's/^\([^\.]*\)\..*$/\1/')
-date_string=$(date +"%Y %b %e @ %T")
+# we only label the terminal anew if there's no saved title.
+
+#hmmm: how about putting that title back in place?
+# we currently do this manually in places, like ssh, which is dumb.
 
-user=$USER
-if [ -z "$user" ]; then
-  # try snagging the windoze name.
-  user=$USERNAME
-fi
 
-new_title="-- $user@$pruned_host -- [$date_string]"
+if [ -z "$PRIOR_TERMINAL_TITLE" ]; then
+  pruned_host=$(echo $HOSTNAME | sed -e 's/^\([^\.]*\)\..*$/\1/')
+  date_string=$(date +"%Y %b %e @ %T")
 
-bash "$FEISTY_MEOW_SCRIPTS/tty/set_term_title.sh" "$new_title"
+  user=$USER
+  if [ -z "$user" ]; then
+    # try snagging the windoze name.
+    user=$USERNAME
+  fi
+  
+  new_title="-- $user@$pruned_host -- [$date_string]"
+  
+  bash "$FEISTY_MEOW_SCRIPTS/tty/set_term_title.sh" "$new_title"
+fi