提交 d7797503 编写于 作者: M moyamo

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.
上级 6a8692da
...@@ -28,6 +28,14 @@ function title { ...@@ -28,6 +28,14 @@ function title {
if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2:q\a" # set window name print -Pn "\e]2;$2:q\a" # set window name
print -Pn "\e]1;$1:q\a" # set tab 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 fi
;; ;;
esac esac
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册