]> git.phdru.name Git - dotfiles.git/commitdiff
Fix(xtitle): Set xterm title/icon under screen/tmux
authorOleg Broytman <phd@phdru.name>
Sun, 25 Apr 2021 21:13:48 +0000 (00:13 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 25 Apr 2021 21:13:48 +0000 (00:13 +0300)
Requires `ESC P...ESC \\` pass-through escape codes.

bin/xtitle

index f734659d5a4a9ea7d7f7f5e03b7adeeb4cb7068c..ce1bd66d117dd16594dbf45c8c5afb5dd76c1988 100755 (executable)
@@ -7,11 +7,14 @@ case "$TERM" in
       else
          TITLE="$@"
       fi
-      echo -n "\033]0;${TITLE}\007" # Set xterm title
       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
+         ;;
       esac
    ;;
 esac