Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: detect ANSI support in more terminals #16080

Merged
merged 2 commits into from
Jun 18, 2023

Conversation

squeek502
Copy link
Collaborator

@squeek502 squeek502 commented Jun 18, 2023

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_api tty.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

nolanderc and 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
Member

Thanks!

Sign up for free to 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