From: Chris Koeritz Date: Tue, 7 Feb 2017 13:16:43 +0000 (-0500) Subject: do not emit term codes if not term X-Git-Tag: 2.140.90~221 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=91144ef11b2aff0939c57c00badcd642d84931f8 do not emit term codes if not term --- diff --git a/scripts/tty/terminal_titler.sh b/scripts/tty/terminal_titler.sh index 329ec57c..f4a18282 100644 --- a/scripts/tty/terminal_titler.sh +++ b/scripts/tty/terminal_titler.sh @@ -72,7 +72,15 @@ function set_terminal_title() if [ -z "${title}" ]; then title="$(hostname)" fi - echo -n -e "\033]0;${title}\007" + + if [ -z "$PS1" ]; then + # not running interactively, so just echo the title. + sep + echo ${title} + sep + else + echo -n -e "\033]0;${title}\007" + fi } # reads the current terminal title, if possible, and saves it to our stack of titles.