From d7797503418422148e84bc06c9e446bdd77c3a01 Mon Sep 17 00:00:00 2001 From: moyamo Date: Thu, 19 Nov 2015 19:03:56 +0200 Subject: [PATCH 1/2] Default to using terminfo to set the terminal title Currently, the title is only set on supported terminals (i.e. xterm, urxvt, screen etc.). Using terminfo entries to set the terminal title adds support for many more terminals. --- lib/termsupport.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 7cf15b0a0..84c1e186e 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -28,6 +28,14 @@ function title { if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then print -Pn "\e]2;$2:q\a" # set window name print -Pn "\e]1;$1:q\a" # set tab name + else + # Try to use terminfo to set the title + # If the feature is available set title + if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then + echoti tsl + print -Pn "$1" + echoti fsl + fi fi ;; esac From 71deb74552d54630d99ae1db3647ebed7b3bc735 Mon Sep 17 00:00:00 2001 From: moyamo Date: Mon, 14 Dec 2015 13:05:51 +0200 Subject: [PATCH 2/2] Fix indentation --- lib/termsupport.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 84c1e186e..871ab28df 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -32,10 +32,10 @@ function title { # Try to use terminfo to set the title # If the feature is available set title if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then - echoti tsl - print -Pn "$1" - echoti fsl - fi + echoti tsl + print -Pn "$1" + echoti fsl + fi fi ;; esac