X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Ftty%2Fterminal_titler.sh;h=eddfb510ebd686336f74491b212b4b518a3317d8;hb=004590778865a3ec9eb36d2b287ad8610212e584;hp=e4262498080b5f89d688d2efbd15c2fa00985e65;hpb=c86cc7027f274f36cc6a313397063971056f6318;p=feisty_meow.git diff --git a/scripts/tty/terminal_titler.sh b/scripts/tty/terminal_titler.sh index e4262498..eddfb510 100644 --- a/scripts/tty/terminal_titler.sh +++ b/scripts/tty/terminal_titler.sh @@ -1,6 +1,7 @@ #!/bin/bash -source $FEISTY_MEOW_SCRIPTS/core/functions.sh +source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" +source "$FEISTY_MEOW_SCRIPTS/core/common.alias" # just saying this is an array... #declare -a PRIOR_TERMINAL_TITLES @@ -72,7 +73,15 @@ function set_terminal_title() if [ -z "${title}" ]; then title="$(hostname)" fi - echo -n -e "\033]0;${title}\007" + + 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 + fi } # reads the current terminal title, if possible, and saves it to our stack of titles.