From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29537 invoked from network); 26 Apr 2001 16:13:15 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Apr 2001 16:13:15 -0000 Received: (qmail 16014 invoked by alias); 26 Apr 2001 16:12:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14127 Received: (qmail 15993 invoked from network); 26 Apr 2001 16:12:58 -0000 From: "Bart Schaefer" Message-Id: <1010426161153.ZM13644@candle.brasslantern.com> Date: Thu, 26 Apr 2001 16:11:53 +0000 In-Reply-To: Comments: In reply to martin.ebourne@arcordia.com "New style completion bug when ctrl-C pressed" (Apr 26, 4:37pm) References: X-Mailer: Z-Mail (5.0.0 30July97) To: martin.ebourne@arcordia.com, zsh-workers@sunsite.dk Subject: PATCH: Re: New style completion bug when ctrl-C pressed MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Apr 26, 4:37pm, martin.ebourne@arcordia.com 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