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

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



Managed to find a workaround (shown at the end of email).

====== Eliminations ======

I did series of eliminations. Conclusion: it's {MYFD}< construct that
is responsible for my problem.

1. Instead of exec {MYFD}< <(...) I did: myfunct {MYFD}< <(...).
Problem still occurred.

This eliminated exec. The function is:

myfunct() { echo "$PCFD" >> /tmp/reply; }

When I add "command" before `echo', the problem disappears! (i.e.
Ctrl-C works). It is a recurring argument, that Zsh needs just a
little push to get out of this Ctrl-C stall. Running a command and not
series of builtins seems to be enough. This yielded a workaround shown
at the end of email.

2. I commented-out zle -F -w invocation. Problem still occurred.

This eliminated zle -F itself and code in zle_main.c/raw_getbyte().

3. I did cat <(...) instead of exec {MYFD}< <(...), problem didn't occur.

This eliminated <(...) as the source of problem. Also did myfunct <(...).

====== Workaround ======

Translating 1. and the `command echo' inside myfunct() into
exec-variant code, I thought that the `command echo ...' should be
placed just after the exec. The actual code (disturbed by long
debugging) is now:

                         exec {PCFD}< <(-fast-highlight-check-path; sleep 5)
                         command sleep 0
                         FAST_HIGHLIGHT[path-queue]+=";$_start_pos $_end_pos;"
                         is-at-least 5.0.6 && __pos=1 || __pos=0
                         zle -F ${${__pos:#0}:+-w} "$PCFD"
fast-highlight-check-path-handler

Ctrl-C works this way. The conclusion from the eliminations is that
{MYFD}< construct is responsible for those Ctrl-C problems. Where in
the source to look for it?

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