From 92a4e318ab6ea30752f5e058757b47352c3ef617 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 14 Nov 2017 19:10:42 -0500 Subject: [PATCH] fixed some issues with terminal title now seems to be behaving again --- scripts/core/launch_feisty_meow.sh | 4 ++-- scripts/tty/terminal_titler.sh | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/core/launch_feisty_meow.sh b/scripts/core/launch_feisty_meow.sh index 7e8ca62d..55b30a86 100644 --- a/scripts/core/launch_feisty_meow.sh +++ b/scripts/core/launch_feisty_meow.sh @@ -215,9 +215,9 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then unset FEISTY_MEOW_SHOW_LAUNCH_GREETING fi - # only run this hello file if the core aliases haven't been loaded already. this + # only run this hello file if the core feisty meow support haven't been loaded already. this # hopefully guarantees we show the info at most once in one shell continuum. - type CORE_ALIASES_LOADED &>/dev/null + type CORE_VARIABLES_LOADED &>/dev/null if [ $? -ne 0 ]; then # print out a personalized hello file if we find one. if [ -f ~/hello.txt ]; then diff --git a/scripts/tty/terminal_titler.sh b/scripts/tty/terminal_titler.sh index f32b10b5..b59dd3dd 100644 --- a/scripts/tty/terminal_titler.sh +++ b/scripts/tty/terminal_titler.sh @@ -4,7 +4,7 @@ source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" source "$FEISTY_MEOW_SCRIPTS/core/common.alias" # uncomment this to get extra noisy debugging. -export DEBUG_TERM_TITLE=true +#export DEBUG_TERM_TITLE=true # puts a specific textual label on the terminal title bar. # this doesn't consider any previous titles; it just labels the terminal. @@ -45,7 +45,8 @@ function set_terminal_title() # echoes back the current title on the terminal window, if we can acquire it. function get_terminal_title() { - local term_title_found + # this is an important value now; it is checked for in save_terminal_title. + local term_title_found="unknown" # save the former terminal title if we're running in X with xterm. which xprop &>/dev/null if [ $? -eq 0 ]; then @@ -54,19 +55,19 @@ function get_terminal_title() term_title_found="$(xprop -id $WINDOWID | perl -nle 'print $1 if /^WM_NAME.+= \"(.*)\"$/')" fi fi - echo "$term_title_found" + echo -n "$term_title_found" } # reads the current terminal title, if possible, and saves it to our record. function save_terminal_title() { local title="$(get_terminal_title)" - if [ ! -z "$title" ]; then + if [ "$title" != "unknown" ]; then # there was a title, so save it. if [ ! -z "$DEBUG_TERM_TITLE" ]; then - echo "saving prior terminal title as '$prior_title'" + echo "saving prior terminal title as '$title'" fi - export PRIOR_TERMINAL_TITLE="$prior_title" + export PRIOR_TERMINAL_TITLE="$title" else # the terminal had no title, or we couldn't access it, or there's no terminal. if [ ! -z "$DEBUG_TERM_TITLE" ]; then -- 2.34.1