zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] Ctrl-C stops working after process substitution
Date: Thu, 5 Jul 2018 09:44:46 +0100	[thread overview]
Message-ID: <20180705084448eucas1p244dbcec9f6d915655cd8bb035fb72f6e~_bI-T7ynp0198101981eucas1p2S@eucas1p2.samsung.com> (raw)
In-Reply-To: <CAKc7PVB5fd-aqgFeuTTpBU9TYUkAfcVT1+PmCGmMFJEij2azVw@mail.gmail.com>

On Wed, 4 Jul 2018 19:07:17 +0200
Sebastian Gniazdowski <sgniazdowski@gmail.com> wrote:
> On 4 July 2018 at 14:09, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:

> > Works for me in master.  
> 
> True, here is code that yields Ctrl-C problem even in zsh -f:
> 
> For zsh -f:
> 
> noop() { IFS='' read line; MYFD="$1"; zle -F "$1"; exec {MYFD}<&-; };
> exec {MYFD}< <( echo a test ); zle -F -w $MYFD noop
> 
> After executing, try Up cursor to obtain some command at prompt (or
> just enter "abcd") and press Ctrl-C. First will be ignored, second one
> will work. This differs from non-zsh-f behavior where any Ctrl-C will
> be ignored. However in zsh -f situation, what's very interesting is
> that the second-Ctrl-C behavior occurs for any number of following
> commands.

My first guess about this is that it's to do with propagation
of errors and interrupts back from the widget.

The -F handling is in the loops beginning

		for (i = 0; i < lnwatch; i++) {

in zle_main.c.  At the end there's a check for errflag and if
it's set the error bit ERRFLAG_ERROR is removed and we ignore that
FD until the read function returns.  There could be something
unhelpful in this area.  In particular we don't do anything with
the interrupt bit ERRFLAG_INT or a hard error ERRFLAG_HARD.

But that's just a guess.

pws


  reply	other threads:[~2018-07-05  8:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 11:47 Sebastian Gniazdowski
2018-07-04 12:09 ` Daniel Shahaf
2018-07-04 17:07   ` Sebastian Gniazdowski
2018-07-05  8:44     ` Peter Stephenson [this message]
2018-07-07 13:03       ` Sebastian Gniazdowski
2018-07-07 13:18         ` Sebastian Gniazdowski
2018-07-07 14:48       ` Sebastian Gniazdowski
2018-07-10 15:06         ` Sebastian Gniazdowski
2018-07-10 15:21           ` Peter Stephenson
2018-07-10 17:57             ` Sebastian Gniazdowski
2018-07-11  8:48               ` Sebastian Gniazdowski
2018-07-11 10:07                 ` 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='20180705084448eucas1p244dbcec9f6d915655cd8bb035fb72f6e~_bI-T7ynp0198101981eucas1p2S@eucas1p2.samsung.com' \
    --to=p.stephenson@samsung.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).