Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Re: New style completion bug when ctrl-C pressed



On Apr 26,  4:37pm, martin.ebourne@xxxxxxxxxxxx wrote:
} 
} There appears to be a bug in the new style completion system whereby if you
} abort the completion with Ctrl-C (as I often do if the machine is not
} readily responding) it doesn't clear up after itself properly.
} 
} The cause would appear to be that a shell function is at some point
} temporarily defined to override the builtin compadd - and this gets left
} around.

Try this.  (Doesn't seem worthwhile to do the same for _complete_help, but
maybe we should consider it.)


diff -ru zsh-forge/current/Completion/Base/Completer/_approximate zsh-4.0/Completion/Base/Completer/_approximate
--- zsh-forge/current/Completion/Base/Completer/_approximate	Mon Apr  2 04:05:44 2001
+++ zsh-4.0/Completion/Base/Completer/_approximate	Thu Apr 26 09:03:30 2001
@@ -61,6 +61,7 @@
     # fi
     builtin compadd "$_correct_expl[@]" "$@"
   }
+  trap '[[ -n "$redef" ]] && unfunction compadd' EXIT INT
 fi
 
 _comp_correct=1
@@ -92,7 +93,6 @@
       [[ "$compstate[list]" != list* ]] &&
           compstate[list]="$compstate[list] force"
     fi
-    [[ -n "$redef" ]] && unfunction compadd
     compstate[pattern_match]="$opm"
 
     return 0
@@ -102,7 +102,6 @@
   (( _comp_correct++ ))
 done
 
-[[ -n "$redef" ]] && unfunction compadd
 compstate[pattern_match]="$opm"
 
 return 1

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author