Browse code

Command title behavior no longer depend on local zsh configuration

Fix by derekjw. closes #52.

Renaud (Nel) Morvan authored on 04/04/2011 at 11:44:48
Showing 1 changed files
... ...
@@ -3,7 +3,7 @@
3 3
 #Fully support screen, iterm, and probably most modern xterm and rxvt
4 4
 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
5 5
 function title {
6
-  if [[ "$TERM" == "screen" ]]; then 
6
+  if [[ $TERM =~ "^screen" ]]; then 
7 7
     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
8 8
   elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
9 9
     print -Pn "\e]2;$2:q\a" #set window name
... ...
@@ -24,6 +24,8 @@ function precmd {
24 24
 #Appears at the beginning of (and during) of command execution
25 25
 function preexec {
26 26
   if [ "$DISABLE_AUTO_TITLE" != "true" ]; then
27
+    emulate -L zsh
28
+    setopt extended_glob
27 29
     local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
28 30
     title "$CMD" "%100>...>$2%<<"
29 31
   fi