summary refs log tree commit diff
path: root/.zsh/title.zsh
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2013-10-31 18:05:05 -0400
committerJune McEnroe <programble@gmail.com>2013-10-31 18:05:05 -0400
commit91e3a40280851bfcea1a61905ab62ff2da3e9836 (patch)
tree019b3d3f0c93454dfa48e39b7bb1cbadab9f6a07 /.zsh/title.zsh
parentShow hostname in prompt over SSH (diff)
downloadsrc-91e3a40280851bfcea1a61905ab62ff2da3e9836.tar.gz
src-91e3a40280851bfcea1a61905ab62ff2da3e9836.zip
Wow look reorganized zsh config
Diffstat (limited to '.zsh/title.zsh')
-rw-r--r--.zsh/title.zsh12
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'