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

Re: check if coproc has output



On Thu, Jan 19, 2023 at 5:24 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
>
> if I invoke the .exe directly, eg:
>
> long_running_process.exe | while etc
>
> the ctrl+c is handled correctly, whether if I enclose it in a function like this:
>
> winclip(){
>   local cmd=($DOTNET_PRJ/pasteclip/pasteclip.exe $args)
>   $cmd "$@"
> }
>
> doing
>
> winclip | while etc
>
> shows the ctrl-c problem

I recall there were recently emails related to unkillable pipelines
and maybe even commits with fixes. You might be able to find them on
zsh-workers.

In any case, you could try to create a minimal test case. For example,
is it necessary to have a `while` loop or can you replace that with a
single read? Is it necessary to invoke the specific executable or can
you invoke something like `sleep 10` instead? Maybe the following
hangs for you?

    f() sleep 10
    f | read

If not, what must be changed so that it starts hanging?

Roman.




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