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

Unable to force color output on Windows #127353

Open
PalmtopTiger opened this issue Nov 28, 2024 · 0 comments
Open

Unable to force color output on Windows #127353

PalmtopTiger opened this issue Nov 28, 2024 · 0 comments
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes OS-windows stdlib Python modules in the Lib dir topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@PalmtopTiger
Copy link

PalmtopTiger commented Nov 28, 2024

Bug report

Bug description:

In can_colorize function, nt._supports_virtual_terminal call takes precedence over checking of environment variables. If the terminal emulator does not support this mode, the environment variables are not checked. This is contrary to the behavior on POSIX OSes, where variables are checked first.

There are third-party terminal emulators that support ANSI color codes, but do not support the new API added in Windows 10. For example, ConEmu and Cmder.

Also, the current behavior makes it impossible to output errors with ANSI codes to a file or through a pipe.

Screenshot of exception in ConEmu terminal:
241128153324_unp

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs

@PalmtopTiger PalmtopTiger added the type-bug An unexpected behavior, bug, or error label Nov 28, 2024
@ZeroIntensity ZeroIntensity added OS-windows stdlib Python modules in the Lib dir 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Nov 28, 2024
@zooba zooba added the topic-repl Related to the interactive shell label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes OS-windows stdlib Python modules in the Lib dir topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants