You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repo and believe that this is not a duplicate.
Issue
Poetry currently suppresses ANSI color codes on Windows. (ref #159)
Modern versions of Windows do in fact support a large number of VT sequences, but applications have to opt-in to this behavior.
Details
Starting with Windows 10 TH2, also known as version 1511, virtually all commonly used VT sequences are supported. However, due to backwards compatibility, applications need to set the ENABLE_VIRTUAL_TERMINAL_PROCESSING console flag to activate this functionality.
The CPython interpreter does not set this flag automatically.
See this comment for more details on the version numbers and some confusion regarding the availability of this feature.
Side note: Build 10.0.14931 is when the console (additionally) gained support for 24-bit colors/truecolor.
Expected behavior / Enhancement
Check the Windows version upon launch (e.g. with platform.version()).
If the version is too old (e.g. Windows 7, Windows 10 TH1, etc.) continue to suppress VT sequences by default, otherwise set the appropriate console flag and emit ANSI codes/VT sequences.
The registry key HKEY_CURRENT_USER\Console\VirtualTerminalLevel controls the default behavior of this functionality (opt-in vs opt-out). Using that and poetry --ansi I can indeed get colored output.
For people using ConEmu and who still do not have colors. You have to enable settings Inject ConEmuHk and ANSI and xterm sequences in ConEmu settings. You will find it in Settings -> Features.
Issue
Poetry currently suppresses ANSI color codes on Windows. (ref #159)
Modern versions of Windows do in fact support a large number of VT sequences, but applications have to opt-in to this behavior.
Details
Starting with Windows 10 TH2, also known as version 1511, virtually all commonly used VT sequences are supported. However, due to backwards compatibility, applications need to set the
ENABLE_VIRTUAL_TERMINAL_PROCESSING
console flag to activate this functionality.The CPython interpreter does not set this flag automatically.
See this comment for more details on the version numbers and some confusion regarding the availability of this feature.
Side note: Build
10.0.14931
is when the console (additionally) gained support for 24-bit colors/truecolor.Expected behavior / Enhancement
Check the Windows version upon launch (e.g. with
platform.version()
).If the version is too old (e.g. Windows 7, Windows 10 TH1, etc.) continue to suppress VT sequences by default, otherwise set the appropriate console flag and emit ANSI codes/VT sequences.
Demonstration
This might serve as a more thorough example of an implementation..
The registry key
HKEY_CURRENT_USER\Console\VirtualTerminalLevel
controls the default behavior of this functionality (opt-in vs opt-out). Using that andpoetry --ansi
I can indeed get colored output.Should this be handled in sdispater/cleo instead?
The text was updated successfully, but these errors were encountered: