From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28216 invoked from network); 29 Jun 2000 09:43:41 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Jun 2000 09:43:41 -0000 Received: (qmail 25689 invoked by alias); 29 Jun 2000 09:43:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12123 Received: (qmail 25667 invoked from network); 29 Jun 2000 09:42:30 -0000 Date: Thu, 29 Jun 2000 10:41:58 +0100 From: Peter Stephenson Subject: Re: PATCH: Re: jobs command in precmd In-reply-to: "Your message of Thu, 29 Jun 2000 10:25:42 BST." <0FWW00BFDSUU9D@la-la.cambridgesiliconradio.com> To: zsh-workers@sunsite.auc.dk (Zsh hackers list), Rob Egelink Message-id: <0FWW00BGWTLY9D@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT I wrote: > > Maybe simply saving and restoring stopmsg when executing > > precmd would be enough. > > This seems to be OK; here's the patch for the latest code in CVS. I'll > send a patch for 3.0.8, too. here it is... there's no CHECK_JOBS option here. > + /* > + * Save stopmsg, since user doesn't get a chance to respond > + * to a list of jobs generated in precmd. > + */ This wasn't really true, of course, since you get precmd just before the command. But I think it's reasonable to expect some conscious action on the part of the user before overriding the check. --- Src/utils.c.old Thu Jun 29 10:25:58 2000 +++ Src/utils.c Thu Jun 29 10:28:33 2000 @@ -595,8 +595,15 @@ /* If a shell function named "precmd" exists, * * then execute it. */ - if ((list = getshfunc("precmd"))) + if ((list = getshfunc("precmd"))) { + /* + * Save stopmsg since the user should type `jobs' themself + * to turn off the exit check. + */ + int osm = stopmsg; doshfunc(list, NULL, 0, 1); + stopmsg = osm; + } if (errflag) return; -- Peter Stephenson Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070