-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
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
hugovk
added a commit
to hugovk/cpython
that referenced
this issue
Dec 12, 2024
hugovk
pushed a commit
that referenced
this issue
Dec 12, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Dec 12, 2024
) (cherry picked from commit 365451e) Co-authored-by: Andrey Efremov <[email protected]>
hugovk
added a commit
to hugovk/cpython
that referenced
this issue
Dec 12, 2024
…on#127354)" This reverts commit 365451e.
hugovk
pushed a commit
that referenced
this issue
Dec 14, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Dec 14, 2024
…127926) (cherry picked from commit 0ac40ac) Co-authored-by: Andrey Efremov <[email protected]>
hugovk
pushed a commit
that referenced
this issue
Dec 15, 2024
Thank you! |
@hugovk, thank you too! |
srinivasreddy
pushed a commit
to srinivasreddy/cpython
that referenced
this issue
Jan 8, 2025
srinivasreddy
pushed a commit
to srinivasreddy/cpython
that referenced
this issue
Jan 8, 2025
…on#127354)" (python#127889) This reverts commit 365451e.
srinivasreddy
pushed a commit
to srinivasreddy/cpython
that referenced
this issue
Jan 8, 2025
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
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:

CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
The text was updated successfully, but these errors were encountered: