Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug? Output not flushed?
- X-seq: zsh-workers 52147
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Bug? Output not flushed?
- Date: Fri, 15 Sep 2023 19:05:00 +0200
- Archived-at: <https://zsh.org/workers/52147>
- In-reply-to: <CAH+w=7YnQmbVqNKHmt6nthB-+1KdFYhXt2vfVu2_uHP6S5RxMg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YnQmbVqNKHmt6nthB-+1KdFYhXt2vfVu2_uHP6S5RxMg@mail.gmail.com>
On 9/15/23, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Easily reproduced:
>
> % { print XXX; return 0; } >| /tmp/newfile; print $(</tmp/newfile)
> % print $(</tmp/newfile)
> XXX
>
> That is, when a return statement appears in a current-shell complex
> list, the output is not flushed until the parser reaches the top level
> again.
I'm not sure if that diagnosis is correct, look at this:
% { print XXX; return 0; } >| /tmp/newfile; echo hello; print $(</tmp/newfile)
and if you put a sleep 10 in there, it still completes immediately,
ie, does the return just return from the whole statement? Isn't that
actually expected since it's not in a function or subshell?
> If the return statement is removed, all is well:
>
> % { print YYY; } >| /tmp/newfile; print $(</tmp/newfile)
> YYY
> %
>
> Any idea where to start looking for this?
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author