From 91e3a40280851bfcea1a61905ab62ff2da3e9836 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 31 Oct 2013 18:05:05 -0400 Subject: Wow look reorganized zsh config --- .zsh/title.zsh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to '.zsh/title.zsh') 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' -- cgit 1.4.1