summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2015-12-14 13:02:31 +0100
committerMarc Cornellà <marc.cornella@live.com>2015-12-14 13:02:31 +0100
commit531789e4fa725e519069118aba0bea63b77466a8 (patch)
tree00014ed740539968cb1b1f793e0252a28b88fa34 /lib
parentbd384a060b835b6a155f1a55338afd15c54e1cb2 (diff)
parent71deb74552d54630d99ae1db3647ebed7b3bc735 (diff)
downloadzsh-531789e4fa725e519069118aba0bea63b77466a8.tar.gz
zsh-531789e4fa725e519069118aba0bea63b77466a8.tar.bz2
zsh-531789e4fa725e519069118aba0bea63b77466a8.zip
Merge pull request #4628 from moyamo/master
Default to using terminfo to set the terminal title
Diffstat (limited to 'lib')
-rw-r--r--lib/termsupport.zsh8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 7cf15b0a0..871ab28df 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