From: Peter Stephenson <p.stephenson@samsung.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH] Fix ctrl-c not working after process substitution
Date: Wed, 10 Apr 2019 08:42:18 +0000 [thread overview]
Message-ID: <1554885738.6252.1.camel@samsung.com> (raw)
In-Reply-To: <20190409183404.23344-1-ericdfreese@gmail.com>
On Tue, 2019-04-09 at 12:34 -0600, Eric Freese wrote:
> This is a potential fix for the ctrl-c problem reported in message 43148
>
> You can reproduce the bug by running `zsh -f`, sourcing the following
> .zshrc, and (at the prompt) pressing ^T and then ^C:
>
> foo-request() {
> exec {FD}< <(echo foo)
> zle -F $FD foo-response
> }
>
> foo-response() {
> zle -F $1
> }
>
> zle -N foo-request
> bindkey ^T foo-request
>
> After pressing ^T, ^C doesn't reset the prompt.
>
> I think this is because the forked <(echo foo) process calls
> entersubsh() without ESUB_ASYNC flag and so is set as the terminal's
> controlling process. My hypothesis is that the original process is never
> reset as the terminal's controlling process and thus the SIGINT signals
> are no longer sent to the original process.
>
> Adding ESUB_ASYNC flag to the entersubsh() call fixes the issue. I'm not
> sure though if there are some cases where we don't want to add the flag
> (e.g. when nullexec is 0)?
Thanks, this makes a lot of sense.
With nullexec it's still in a subprocess, so I think that's OK.
Some of the other similar functions use ESUB_ASYNC and some use
ESUB_NOMONITOR --- possibly they should be more consistent.
I'll just apply it as it is.
Cheers
pws
prev parent reply other threads:[~2019-04-10 8:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20190409183514epcas2p3d19839c97731d5b19dc05586ec9346c7@epcas2p3.samsung.com>
2019-04-09 18:34 ` Eric Freese
2019-04-10 8:42 ` Peter Stephenson [this message]
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=1554885738.6252.1.camel@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).