Re: Preserve DPUTS output in comptest-based tests

Bart Schaefer <[email protected]> Wed, 17 Jun 2026 18:13:04 -0700
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAH+w=7Z2HM43RE9rnatqm8fxhfMiTk3NseNQrf5LtmFEor2SJw@mail.gmail.com>
On Wed, Jun 17, 2026 at 5:45 PM Philippe Altherr
<[email protected]> wrote:
>
> One thing I don't like too much with the current patch is that it doesn't respect the output order.
> The DPUTS messages appear in between other messages, presumably in the order they were found in the output.
> I'm wondering whether tackling this ordering issue would be worth the added complexity.

This is probably happening because the PTY output is being buffered --
I suspect in the case where they are grouped together it's not
line-buffered and where they are separated it is line-buffered, though
what you may have done to change it I don't immediately see.

It's probably more helpful to have the DPUTS output appear adjacent to
the input that triggered it, even though strictly speaking DPUTS
should be treated like stderr rather than like "normal" test output.
You could experiment with having zpty_handle_dputs use "print -u2".