Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: check if coproc has output
- X-seq: zsh-users 28672
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
- Cc: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: Re: check if coproc has output
- Date: Thu, 19 Jan 2023 17:33:04 +0100
- Archived-at: <https://zsh.org/users/28672>
- In-reply-to: <CAP+y1xA9h9T=0QZ4aUHj2mytzzb8bOcR9-wO=kADZ=mQ1_APNw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAP+y1xA95KonZu=c2FKsf7mhTHsFs-B4O4rS4zWhRuV9-UuVKg@mail.gmail.com> <CAN=4vMqvZx4i8HG8ZxCkXYaURes2KezEYZxUAPrZHvXk+6SXtQ@mail.gmail.com> <CAP+y1xA9h9T=0QZ4aUHj2mytzzb8bOcR9-wO=kADZ=mQ1_APNw@mail.gmail.com>
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