zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: Functions registered with zle -F stop being run after a job finishes
Date: Wed, 27 Mar 2019 19:01:54 +0000	[thread overview]
Message-ID: <56c3839eace1c03fc36cd93bbed7d5ed3e8936cd.camel@ntlworld.com> (raw)
In-Reply-To: <681eee2a4531f27e3b553eeb18ec4e5864858b15.camel@ntlworld.com>

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) {



  reply	other threads:[~2019-03-27 19:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23 13:55 Roman Perepelitsa
2019-03-23 18:30 ` Peter Stephenson
2019-03-27 19:01   ` Peter Stephenson [this message]
2019-03-28 10:31     ` Roman Perepelitsa
2019-03-25 22:11 ` Roman Perepelitsa
2019-03-26  9:22   ` Peter Stephenson
2019-03-26  9:36     ` Roman Perepelitsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56c3839eace1c03fc36cd93bbed7d5ed3e8936cd.camel@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).