Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Zptyfy W01history.ztst
- X-seq: zsh-workers 55268
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Oliver Kiddle <opk@xxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Zptyfy W01history.ztst
- Date: Sun, 15 Nov 2026 05:13:12 +0100
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+2HF72T3lMhOO5PrNxmFEJLhzujZC7C0MCPLbH+FOC0=; fh=UQnFp/oC/75wfvo8RynRz1FZNIXZ/f5USMRW2qXjK58=; b=LAeA5XSl9K3B3E5W2R3MLKnWKHIk3Q9DuREyHFEMpKFlyqayKtXcXHyFbrwQDYyr71 CALrLw3NDv6KgANRUHfGNWdVOcliQf8PGuY1t7shBQUMaJUCPqauIIinxOj4KGDP3BM1 3urUFKbXBv2vgy25zAsNTKqUIFXTHSyZl6UJ+omJfX8HIhe1aqUZ7Xdw2fIwYo4oMAmg HrTZlD6h3CMFqR87/j16DU8zDM5jUaZ2TN65JZSE6sh0NdrFTAj2YM/J1FOQJWNiclua 2zAso3PpTx9/Ovfhem1mO7KltOVjmKh4NUAcibUjYECjtzXrNeko12ysKPYC6Y8Z4Y9R 4SuQ==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1794716005; cv=none; d=google.com; s=arc-20260327; b=IlzH7ZZklmwgOkEUrq6WDAhxirBxS3Jkvpm+BnJ4rcTnYuGa8iq9hijXibIsd2pfXM ailXi91Hf/1iDezRsRz2Lo4sSP17GbQe1N2EfEge1yMj0ex1G53EdtfkiAfmQCR3h3eq Qs33GEs/eQfV8pQCT6f2SPYI0JHrEcc3+IjGSkjBCjUypHkAFusK7EOFGKA33pYnstM8 LNhbCdUWlMJ4q9k+nb3GimyI4NrE0wBrg4y+o4SY0Of+40oveC0MEKh2DUZadr31ep0/ CIzYBY1RZ55kM2mRSZMSb0dQXMVVsmTWNqCx1pPoX3Mc5PfeuETUBYlN22zawEUQrlKi 9Ghg==
- Archived-at: <https://zsh.org/workers/55268>
- In-reply-to: <CAGdYchvzMRe29hH+HabtKTu+OvZxdiAuJuKXRJQZ32nt-0feRQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchtBrqRDaYYf3jDO7J_rVhPzrPMK2oqwVHW_0nRFe4bB-A@mail.gmail.com> <16926-1794448080.732427@hr-V.RJx7.qdP2> <CAGdYchvzMRe29hH+HabtKTu+OvZxdiAuJuKXRJQZ32nt-0feRQ@mail.gmail.com>
On Sun, Nov 15, 2026 at 3:36 AM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>>
>> The zpty tests have a number of disadvantages like zpty not building on
>> obscure platforms. This change forces you to run the tests under zpty.
>> For the completion and zle tests we really need to capture the terminal
>> output so have no choice but this isn't the case for the history tests.
>> Being able to run tests without zpty can be easier when debugging a
>> problem.
>
>
> I agree, having to use zpty is far from ideal. In addition to what you mention, it's also much slower.
>
>>
>> For the history tests, I think it makes more sense to run zpty a layer
>> above in the test driver script. I've attached a patch to do this. This
>> is only being used where $OSTYPE is linux-gnu because Linux doesn't
>> support stty flusho for silencing that output. I was more concerned with
>> the extra noise from those history tests.
>
>
> I didn't know `stty flusho`. I didn't even know `stty` but this looks like a much better option for this case.
>
> From the last line in the first diff of your patch, I inferred that you added a `stty flusho < $TTY` at the start of each test case and a `stty -flusho < $TTY` at their end. I would rather do that in the test runner for tests that require to mute the tty. Instead of hardcoding a list of tests that require this, I would rather encode it in their file name, for example with an `@mutetty` suffix. For Linux, where this trick unfortunately doesn't work, I think that we could use `script` rather than relying on `zpty`. Gemini tells me that it's standard on pretty much all Linux boxes.
>
> See the attached script, which for now is still experimental mainly because I haven't tested at all the Linux code path. Note that it's built on top of these two other patches:
>
> - Use test script specific run directories - workers/55185
> - Add support for running test scripts in parallel - workers/55186
>
>> Do we perhaps need to also
>> use zpty where tests are being run in parallel even for other platforms?
>
>
> I guess there might be other platforms where the `stty` trick doesn't work. We can add workarounds for them as we discover them. If they don't have `script` or an equivalent, we can use `zpty` as a last resort.
>
>> > + skip s:$'\e]11;?\e\\' && # OSC 11: Query terminal's background color
>> > + skip s:$'\e]10;?\e\\' && # OSC 10: Query terminal's foreground color
>> > + skip s:$'\e]12;?\e\\' && # OSC 12: Query terminal's cursor color
>>
>> If we do end up with a variant of this patch then rather than skip
>> these escapes, disabling them all is cleaner and likely more robust.
>> That's with .term.extensions. It also looks like you're skipping the
>> partial line marker from the PROMPT_SP option - again easier to unset
>> the option. For anything that comes from termcap, actual termcap
>> entries may vary. zle -T can cover ZLE but not all termcap output comes
>> from ZLE.
>
>
> I didn't know that you could disable some of that stuff. That looks indeed much more robust. I will keep the infrastructure I built in the patch and your comments but it looks like we won't need them for W01history.ztst.
>
>> (As an aside, why is there a $ZTST_failcolour but nothing for the
>> success and warning colours)
>
>
> In Add support for running test scripts in parallel (workers/55186), I added (and documented in README) $ZTST_warncolour and $ZTST_passcolour.
Wouldn't messing directly with the parent stty settings mess up stuff
badly if we do end up running tests in parallel at some point?
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author