From 91144ef11b2aff0939c57c00badcd642d84931f8 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 7 Feb 2017 08:16:43 -0500 Subject: [PATCH] do not emit term codes if not term --- scripts/tty/terminal_titler.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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. -- 2.34.1