Skip to content

windows: detect ANSI support in more terminals - #16080

Merged
andrewrk merged 2 commits into
ziglang:masterfrom
squeek502:windows-vt
Jun 18, 2023
Merged

windows: detect ANSI support in more terminals#16080
andrewrk merged 2 commits into
ziglang:masterfrom
squeek502:windows-vt

Conversation

@squeek502

@squeek502squeek502 commented Jun 18, 2023

Copy link
Copy Markdown
Member

This is a revival of #15282

Helps mitigate #15976 (and may be enough to warrant closing that issue if we're fine with the .windows_apitty.Config having slightly different behavior than .escape_codes, see the "Potential solutions" at the bottom of that issue)


From #15282 (comment):

The new build runner means that on Windows the SetConsoleTextAttribute colors are not preserved when a test case fails. In combination with #13816 / #13723, this makes the output for expectEqualSlices much less useful.

With the changes in this PR, the colors are preserved (at least with Windows Terminal).

Before this PR:

15206-before

After this PR:

15206-after

nolandercand others added 2 commits June 17, 2023 23:30
isatty on Windows is implemented as a isCygwinPty call and a GetConsoleMode call, so calling isatty just duplicates the function calls we already need to do in supportsAnsiEscapeCodes.
@andrewrk

Copy link
Copy Markdown
Member

Thanks!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@squeek502@andrewrk@nolanderc