a3e92892bbc95acc270d93b45be05c55348da55c

Author
Renaud (Nel) Morvan <nel@w3fu.com>
Committer
Renaud (Nel) Morvan <nel@w3fu.com>
Date

Message

Command title behavior no longer depend on local zsh configuration

Fix by derekjw. closes #52.

Diff

 1diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 2index 494ef8923cbb7fad7e2429ff041c6d923e105e8d..42bbb9ef2d2dacbacad9f6a0832f6b76b110dcfb 100644
 3--- a/lib/termsupport.zsh
 4+++ b/lib/termsupport.zsh
 5@@ -3,7 +3,7 @@
 6 #Fully support screen, iterm, and probably most modern xterm and rxvt
 7 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
 8 function title {
 9-  if [[ "$TERM" == "screen" ]]; then 
10+  if [[ $TERM =~ "^screen" ]]; then 
11     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
12   elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
13     print -Pn "\e]2;$2:q\a" #set window name
14@@ -24,6 +24,8 @@ function precmd {
15 #Appears at the beginning of (and during) of command execution
16 function preexec {
17   if [ "$DISABLE_AUTO_TITLE" != "true" ]; then
18+    emulate -L zsh
19+    setopt extended_glob
20     local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
21     title "$CMD" "%100>...>$2%<<"
22   fi