From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7881 invoked from network); 12 Dec 1999 22:59:06 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Dec 1999 22:59:06 -0000 Received: (qmail 7588 invoked by alias); 12 Dec 1999 22:58:49 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2773 Received: (qmail 7580 invoked from network); 12 Dec 1999 22:58:48 -0000 From: "Bart Schaefer" Message-Id: <991212225840.ZM9656@candle.brasslantern.com> Date: Sun, 12 Dec 1999 22:58:39 +0000 In-Reply-To: Comments: In reply to nirva@ishiboo.com (Danny Dulai) "tostop && TTOU" (Dec 12, 11:22am) References: X-Mailer: Z-Mail (5.0.0 30July97) To: nirva@ishiboo.com (Danny Dulai), zsh-users@sunsite.auc.dk Subject: Re: tostop && TTOU MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Dec 12, 11:22am, Danny Dulai wrote: } Subject: tostop && TTOU } } I'm trying to get TTOU generated in a script, without forcing the user to } stty tostop in the terminal controling shell. You're going to have to give a few more details about the script. In order to get a TTOU, the script itself must run in the background, or it starts a background job; which one is it? I played with this a bit, and if I run a script in the background which attempts to do anything with stty, it gets TTOU even when the original stty settings include -tostop. I can only change the settings with a foreground job. } Can anyone give me an explaination of how tostop and TTOU interact with } multiple layers of shells? In shells with job control, which does not include scripts, zsh itself ignores TTIN and TTOU; for other shells, it does not change the default signal handling of TTIN or TTOU (which means they'll be ignored if the parent process was ignoring them). After forking (but, obviously, before exec'ing) an external process or subshell, if job control is still active, zsh resets the TTIN and TTOU handlers to the system default (which should be to stop the process). But those aren't the only details involved. Zsh also resets the tty driver flags during various stages of ZLE processing, which can cause changes made by other processes to be lost, and it changes (or doesn't) the tty process group of subjobs in some cases, which may prevent them from receiving tty signals (including TTIN/TTOU). -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com