From c86cc7027f274f36cc6a313397063971056f6318 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sun, 22 Jan 2017 16:26:30 -0500 Subject: [PATCH] fixed for cases without WINDOWID --- scripts/tty/terminal_titler.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/tty/terminal_titler.sh b/scripts/tty/terminal_titler.sh index 3751ba24..e4262498 100644 --- a/scripts/tty/terminal_titler.sh +++ b/scripts/tty/terminal_titler.sh @@ -81,7 +81,8 @@ function save_terminal_title() # save the former terminal title if we're running in X with xterm. which xprop &>/dev/null if [ $? -eq 0 ]; then - if [[ "$TERM" =~ .*"xterm".* ]]; then + # make sure we're actually using xterm *and* that we have a window ID. + if [[ "$TERM" =~ .*"xterm".* && ! -z "$WINDOWID" ]]; then local prior_title="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')" if [ ! -z "$prior_title" ]; then #echo "saving prior terminal title as '$prior_title'" -- 2.34.1