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

Re: [BUG] Ctrl-C stops working after process substitution



On 5 July 2018 at 10:44, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> 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.

I'm trying to debug it now. I noted, that the handler (noop) isn't
run. Tried to attach from within Zle:

noop() { print "I'm ran" >> /tmp/reply; IFS='' read line; MYFD="$1";
zle -F "$1"; exec {MYFD}<&-; };
exec {MYFD}< <( sleep 2; echo a test ); attach() { zle -F -w $MYFD
noop; }; zle -N attach; bindkey '^T' attach

But still cannot see the `print' message in /tmp/reply. This is weird
as this works from bigger script, maybe there's a mistake?

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin



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