more brains for term check
authorFred T. Hamster <fred@gruntose.com>
Tue, 7 Feb 2017 14:14:27 +0000 (09:14 -0500)
committerFred T. Hamster <fred@gruntose.com>
Tue, 7 Feb 2017 14:14:27 +0000 (09:14 -0500)
scripts/tty/terminal_titler.sh

index 66e0c28bbfe6b8ba64577d09f964db9cf3e76aef..eddfb510ebd686336f74491b212b4b518a3317d8 100644 (file)
@@ -74,13 +74,13 @@ function set_terminal_title()
     title="$(hostname)"
   fi
   
-  if [ -z "$PS1" ]; then
+  if [ "${TERM}" != "dumb" -a -z "$PBS_ENVIRONMENT" -a ! -z "$PS1" ]; then
+    echo -n -e "\033]0;${title}\007"
+  else
     # not running interactively, so just echo the title.
     sep
     echo ${title}
     sep
-  else
-    echo -n -e "\033]0;${title}\007"
   fi
 }