浏览代码

Merge pull request #4628 from moyamo/master

Default to using terminfo to set the terminal title
Marc Cornellà 9 年之前
父节点
当前提交
531789e4fa
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      lib/termsupport.zsh

+ 8 - 0
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