zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Ctrl-c not working during correction with 5.1
Date: Tue, 1 Sep 2015 11:15:02 -0700	[thread overview]
Message-ID: <150901111502.ZM2072@torch.brasslantern.com> (raw)
In-Reply-To: <20150901141031.GB423@x4>

On Sep 1,  4:10pm, Markus Trippelsdorf wrote:
}
} I cannot abort a correction with Ctrl-c anymore, e.g.:
} 
} markus@x4 tmp % la
} zsh: correct 'la' to 'lz' [nyae]? <press Ctrl-c and nothing happens>

Unintended side-effect of all the race-condition-prevention work that
went on this summer.

diff --git a/Src/utils.c b/Src/utils.c
index 4c4dc55..90f7c33 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2538,11 +2538,16 @@ static int
 read1char(int echo)
 {
     char c;
+    int q = queue_signal_level();
 
+    dont_queue_signals();
     while (read(SHTTY, &c, 1) != 1) {
-	if (errno != EINTR || errflag || retflag || breaks || contflag)
+	if (errno != EINTR || errflag || retflag || breaks || contflag) {
+	    restore_queue_signals(q);
 	    return -1;
+	}
     }
+    restore_queue_signals(q);
     if (echo)
 	write_loop(SHTTY, &c, 1);
     return STOUC(c);

-- 
Barton E. Schaefer


  reply	other threads:[~2015-09-01 18:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 14:10 Markus Trippelsdorf
2015-09-01 18:15 ` Bart Schaefer [this message]
2015-09-02 13:10   ` Christian Neukirchen
2015-09-02 14:09     ` Bart Schaefer
2015-09-03  2:32     ` Bart Schaefer
2015-09-03  3:00       ` Mikael Magnusson
2015-09-10 15:09         ` PATCH: Builtin exit from inside ZLE widget Bart Schaefer
2015-09-03  3:17       ` Ctrl-c not working during correction with 5.1 Bart Schaefer
2015-09-03 13:21         ` Christian Neukirchen
2015-09-03 16:39     ` Peter Stephenson

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=150901111502.ZM2072@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).