diff options
Diffstat (limited to '')
-rw-r--r-- | .zsh/title.zsh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/.zsh/title.zsh b/.zsh/title.zsh index b0d7ad70..5a00c458 100644 --- a/.zsh/title.zsh +++ b/.zsh/title.zsh @@ -1,9 +1,9 @@ function _title { - echo -en "\033]0;$@\a" + print -Pn "\033]0;$@\a" } function title { - if [ -n "$1" ]; then + if [[ -n "$1" ]]; then _title_custom=1 _title $@ else @@ -13,14 +13,18 @@ function title { } function _title_preexec { - [ -z "$_title_custom" ] && _title "$1" + [[ -z "$_title_custom" ]] && _title "$1" } +unset _title_host +[[ -n "$SSH_CLIENT" ]] && _title_host='%m:' + function _title_precmd { - [ -z "$_title_custom" ] && _title zsh + [[ -z "$_title_custom" ]] && _title '$_title_host%1~$(gitprompt nocolor)' } typeset -ga preexec_functions typeset -ga precmd_functions + preexec_functions+='_title_preexec' precmd_functions+='_title_precmd' |