From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29636 invoked by alias); 8 Dec 2014 12:43:29 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33930 Received: (qmail 6645 invoked from network); 8 Dec 2014 12:43:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mGfpbcnOuZ3Xh8pudbLQ6QAtwNfnigHzuiWBMdA8p3M=; b=RnVmWQ7YB5fGoUbPXSYyPts0xYKu08t9O+ADR151u8UDONzoIZOAhg/cCUpq5U8Xvz ddHjbGtsIBOadz9OQNKO4sjF0/WB/bfwxxStv+TFR4fY1TX7dG5I+eu1Jw9zFtVKbHn6 +IGp1qB8ySZof3mVNVgpPCm+cZsBpK/Wuu+tpZxKFD9IX28jd+uoZVJd2E81IGzStEhq 0nPyJlej6sU2z2peqXmUOsW4qODxHtWXrnOUvHopPbibRmDN3Mtf+tvNy6n/UVWLfWzA Qm0Er3UYkzw1vri9xJ8/wxDGrK/IWIaFLaUDtFiQeTLCGmIA8lzBCNAjQup1Lopx3pj9 gJVQ== MIME-Version: 1.0 X-Received: by 10.107.130.197 with SMTP id m66mr10745336ioi.10.1418042591996; Mon, 08 Dec 2014 04:43:11 -0800 (PST) In-Reply-To: <20141208111806.5cd1ced5@pwslap01u.europe.root.pri> References: <20141202155452.647182b4@pwslap01u.europe.root.pri> <141202084858.ZM31517@torch.brasslantern.com> <20141202172654.30e7d380@pwslap01u.europe.root.pri> <141204085606.ZM9146@torch.brasslantern.com> <20141204171226.301e9d2c@pwslap01u.europe.root.pri> <141205002023.ZM19736@torch.brasslantern.com> <20141205145054.655a2f70@pwslap01u.europe.root.pri> <141205100632.ZM508@torch.brasslantern.com> <20141205181330.2b458b46@pwslap01u.europe.root.pri> <20141205203417.2bc66b7b@pws-pc.ntlworld.com> <20141205220717.2f86bdd2@pws-pc.ntlworld.com> <141206211828.ZM15934@torch.brasslantern.com> <20141207170713.1a71fe0d@pws-pc.ntlworld.com> <20141207171920.0913aae9@pws-pc.ntlworld.com> <20141208111806.5cd1ced5@pwslap01u.europe.root.pri> Date: Mon, 8 Dec 2014 13:43:11 +0100 Message-ID: Subject: Re: Interrupting globs (Re: Something rotten in tar completion) From: Mikael Magnusson To: Peter Stephenson Cc: "Zsh Hackers' List" Content-Type: text/plain; charset=UTF-8 On Mon, Dec 8, 2014 at 12:18 PM, Peter Stephenson wrote: > On Sun, 7 Dec 2014 17:19:20 +0000 > Peter Stephenson wrote: >> diff --git a/Src/jobs.c b/Src/jobs.c >> index 6e47e5e..3c2a21a 100644 >> --- a/Src/jobs.c >> +++ b/Src/jobs.c >> @@ -1444,7 +1444,19 @@ zwaitjob(int job, int wait_cmd) >> restore_queue_signals(q); >> return 128 + last_signal; >> } >> - errflag &= ~ERRFLAG_ERROR; >> +/*...*/ >> + errflag = 0; */ >> + >> if (subsh) { >> killjb(jn, SIGCONT); >> jn->stat &= ~STAT_STOPPED; > > Aha! Spotted when trying out TRY_BLOCK_INTERRUPT. > > I only switched ERRFLAG_ERROR to ERRFLAG_INT when the shell *itself* > gets the interrupt. The case here, and in the test I was running, is > where we propagate a SIGINT detected by WTERMSIGing (er, that's a verb, > right?) a process that exited because it received the ^C (and the shell > wasn't part of the foreground process group). > > The following patch (applicable to the interrupt_abort branch) makes > TRY_BLOCK_INTERRUPT do sensible things in that case. Needless to say I > haven't dared back off the patch quoted above again... > > By the way, the cases below already handle SIGINT and SIGQUIT in > parallel, which suggest the code I added to do this for mimicking signals > on return from a trap is at least consistent. (Since this is maybe a little known feature of git, :/foo is the first reachable commit on any branch with the string foo in the commit name, you can literally say git revert :/'this is a very good solution with no drawbacks' ). Good news and bad news, with this latest patch, I can revert :/'Put back commenting' and still ctrl-c out of cd ../linux in one go, BUT, when I do, with or without the revert, it immediately puts me back at the prompt without executing preexec(). Test case for you guys: % zsh -f % precmd() echo yes % sleep 2; echo no ^C yes With :/'Ensure propagation' and :/'Put back' (eg, current tip of interrupt_abort), I get neither printed. Reverting :/'Put back' still gets me neither (ie, it makes no difference, which I guess is the goal of this, so yay?). With both reverted, I get what I originally reported (obviously) ^C no yes With only :/'Ensure propagation' reverted (eg, at the previous tip), I get ^C yes So I guess some other place needs to clear interrupts as well, or the "return to commandline" clear should be before precmd being called? (If that's nonsense it's because I haven't looked at the code for that at all). -- Mikael Magnusson