From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4188 invoked from network); 29 Jun 2001 16:35:59 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Jun 2001 16:35:59 -0000 Received: (qmail 12721 invoked by alias); 29 Jun 2001 16:34:55 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3983 Received: (qmail 12703 invoked from network); 29 Jun 2001 16:34:54 -0000 From: "Bart Schaefer" Message-Id: <1010629163446.ZM15301@candle.brasslantern.com> Date: Fri, 29 Jun 2001 16:34:46 +0000 In-Reply-To: <200106290916.LAA04443@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: Functions that start Jobs" (Jun 29, 11:16am) References: <200106290916.LAA04443@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.dk Subject: Re: Functions that start Jobs MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 29, 11:16am, Sven Wischnowsky wrote: } Subject: Re: Functions that start Jobs } } Vincent Lefevre wrote: } } > What happens if Ctrl-Z is typed while a builtin } > is being executed? } } (Very good. ;-) That won't work because we need something to find out } that something got suspended. Some time ago we were discussing if it } was possible to make this work, too. I don't remember exactly, but } nothing came of it. It'd be pretty messy. We'd either have to fork() in a signal handler (which I'm sure is not a good idea), or else set a flag for TSTP the way zsh presently does for INT -- and then at every point where we check the INT'd flag, also check the TSTP'd flag and fork(), with the child then STOPping itself and the parent breaking out as if INT'd. Or we could use pthreads and put every command that's executed in the current shell into its own thread. But without a massive rewrite, we'd have to make sure that no more than one thread at a time (including the "parent" one) was ever executing -- so either it would not be possible to put a stopped builtin in the background, or we'd still have to fork() and continue only one thread in each process, and I'm really not sure if that works any better than forking in a signal handler. -- 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