From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id a4a3c87c for ; Wed, 27 Mar 2019 19:02:58 +0000 (UTC) Received: (qmail 12326 invoked by alias); 27 Mar 2019 19:02:39 -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: List-Unsubscribe: X-Seq: 44185 Received: (qmail 13630 invoked by uid 1010); 27 Mar 2019 19:02:39 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-3.server.virginmedia.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.1/25398. spamassassin: 3.4.2. Clear:RC:0(80.0.253.67):SA:0(-2.0/5.0):. Processed in 3.000805 secs); 27 Mar 2019 19:02:39 -0000 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _smtprelay.virginmedia.com designates 80.0.253.67 as permitted sender) X-Originating-IP: [86.16.88.158] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.3 cv=YdyTGTZf c=1 sm=1 tr=0 a=MiHCjVqLJ44lE3bxSlffFQ==:117 a=MiHCjVqLJ44lE3bxSlffFQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=uU6PFt2RDdv7yeM9GHYA:9 a=cgStkCUaAMqBqHOJ:21 a=LjoTRhezuGWnNxJp:21 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1553713315; bh=mweyOmuzC1SdyQ84bR+61Ku3ntgNxAg5iskTNqavWsA=; h=Subject:From:To:Date:In-Reply-To:References; b=LuvWLjQR9lQhFA2Eraa1PPDgEP5eAX1+OzZY9jBj8OSzb8TcppnllbpdB/qnvnJ64 yX5/ZrurLbiCopUwLRF49b5qMR2yjD0iSEUWGKS3ZmlePaMVYAHNKCuDHYHGeuh2O+ P8uvoRi1uId+em0yWsOPy+06y/dzsrvup7RYaZ2rfVeKasBhx63Ux9xuSK4x+gj94E ephrwqKOnFM7pGsInm7BR0Aszb1FzQG4cFTDeaNjXSBNQ+cYY7/7D/vdHZviF3VPIO 1nKBtk4kHZjFXnpuk7veOuqusn3S7hDhO0yUY5X5gYdBJoqQ1v58Xx6xn11IHJKc82 /lOtKaihFqnNw== Message-ID: <56c3839eace1c03fc36cd93bbed7d5ed3e8936cd.camel@ntlworld.com> Subject: Re: Functions registered with zle -F stop being run after a job finishes From: Peter Stephenson To: zsh-workers@zsh.org Date: Wed, 27 Mar 2019 19:01:54 +0000 In-Reply-To: <681eee2a4531f27e3b553eeb18ec4e5864858b15.camel@ntlworld.com> References: <681eee2a4531f27e3b553eeb18ec4e5864858b15.camel@ntlworld.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfFTMrFeGY7i7Ja5IUfPfurvf9Q3vaovK4YDttNLHAh1m8T60CZ43J2WT+1GSZ2Gv4WC3j/hLSUtsqg83hVa095ri5pyFhYcJdbGmKDDZa2v5mT0ooizh gfM+Jnrdbn3TOw7L3/hTS5PNcbkE6LYn7PgSVdZQgnG0UNbRVTzO/YJi On Sat, 2019-03-23 at 18:30 +0000, Peter Stephenson wrote: > > tl;dr: There appears to be a bug in zsh. When a background job finishes, > > functions registered with zle -F stop running until the user presses a key > > (say, [enter] or [esc]) or the shell receives a signal (any signal at all). > > It's going to be something like the following. On second thoughts I don't think removing ERRFLAG_INT is a good idea --- that won't be set in the case in question as there's no user keyboard interrupt, and if there was one we shouldn't ignore it. Committed the following. pws modified Src/Zle/zle_main.c @@ -632,7 +632,11 @@ raw_getbyte(long do_keytmout, char *cptr, int full) * with all fds, then try unsetting the special ones. */ if (selret < 0 && !errtry) { - errtry = 1; + /* Continue after irrelevant interrupt */ + if (errno != EINTR) { + /* Don't trust special FDs */ + errtry = 1; + } continue; } if (selret == 0) {