Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Functions registered with zle -F stop being run after a job finishes



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




Messages sorted by: Reverse Date, Date, Thread, Author