From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id FAA26106 for ; Sat, 20 Jul 1996 05:57:39 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id PAA24677; Fri, 19 Jul 1996 15:52:38 -0400 (EDT) Resent-Date: Fri, 19 Jul 1996 15:52:38 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960719125325.ZM320@candle.brasslantern.com> Date: Fri, 19 Jul 1996 12:53:25 -0700 In-Reply-To: "Bart Schaefer" "Re: Another patch to compctl-examples CVS compctl, and a bug?" (Jul 14, 7:32pm) References: <199607150102.DAA03226@turan.elte.hu> <960714193241.ZM1933@candle.brasslantern.com> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.702 02jul96) To: schaefer@nbn.com, Zoltan Hidvegi Subject: Re: Another patch to compctl-examples CVS compctl, and a bug? Cc: zsh-workers@math.gatech.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"4TO412.0.W16.0U-xn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1721 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 14, 7:32pm, Bart Schaefer wrote: > > On Jul 15, 3:02am, Zoltan Hidvegi wrote: > } > } "${pref}${^${${(f@)$({<${pref}CVS/Entries} 2>/dev/null)}#/}%%/*}" > > Here's the behavior I see in a directory that has no CVS subdirectory: > > If I replace my `for ... echo' loop with your ${^...} solution above, > then *every* time I hit TAB I get a newline on the terminal, and I > never see any completions. (Your solution works normally in a dir > that *does* have a CVS subdir.) I think I finally tracked this down, crashing my Linux 1.3.15 kernel three times in the process. (Use GDB to put a breakpoint on a system call such as write(), and then watch what happens when the process forks and the child uses the system call.) When you write this form of READNULLCMD: $( { /dev/null ) Zsh forks to execute the { ... } part so that it can redirect stderr. READNULLCMD in the child process then discovers that nonexistentfile doesn't exist, and calls zerr() to output the "no such file" message. This is all fine most of the time, but when the above is used in a completion, zleactive==1 and so zerr() calls trashzle(). The child thus messes up the parent's terminal. However, I don't know where to put a `zleactive = 0;' to prevent this. Does it go in getoutput()? That would solve this particular case, but there might be others. Does it go in entersubsh()? Or is entersubsh() sometimes called when we haven't really forked? Insights appreciated.