From 5ebb08f797da6fa0961ea0bd95cf1c44fe1c433f Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 26 Apr 2021 19:28:44 +0300 Subject: [PATCH] Refactor(xtitle): Reuse `$TITLE` --- bin/xtitle | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/xtitle b/bin/xtitle index ce1bd66..b88560a 100755 --- a/bin/xtitle +++ b/bin/xtitle @@ -7,14 +7,13 @@ case "$TERM" in else TITLE="$@" fi + XTITLE="\033]0;${TITLE}\007" # Set xterm title/icon case "$TERM" in screen*) - echo -n "\033P\033]0;${TITLE}\007\033\\" # Set xterm title/icon - echo -n "\033k${TITLE}\033\\" # Set screen/tmux caption - ;; - *) - echo -n "\033]0;${TITLE}\007" # Set xterm title/icon + XTITLE="\033P${XTITLE}\033\\\\" # Set xterm title/icon under screen/tmux + XTITLE="${XTITLE}\033k${TITLE}\033\\\\" # Set screen/tmux caption ;; esac + echo -n "$XTITLE" ;; esac -- 2.39.5