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
so that if ENABLE_VIRTUAL_TERMINAL_PROCESSING is already set, the output stream is seen as ANSI-enabled, and otherwise, only report ANSI-enabled if successfully able to change modes.
This also fixes the issue that the return value of kernel32.SetConsoleMode is not being checked, although I'm not aware of a situation that would reject that particular call.
This is a replication of sdispater/clikit#35, as the faulty code moved from clikit to cleo.
The current final test of
StreamOutput._has_color_support
on Windows: https://github.com/sdispater/cleo/blob/7ebf50b4c85e0eca2d9f295588150527c95c84de/cleo/io/outputs/stream_output.py#L141-L147returns
False
ifENABLE_VIRTUAL_TERMINAL_PROCESSING
is already enabled, as is the case for Windows Terminal.It should return
True
, since ifENABLE_VIRTUAL_TERMINAL_PROCESSING
is already enabled, then we clearly have ANSI.I suggest flipping the logic to look like
so that if
ENABLE_VIRTUAL_TERMINAL_PROCESSING
is already set, the output stream is seen as ANSI-enabled, and otherwise, only report ANSI-enabled if successfully able to change modes.This also fixes the issue that the return value of
kernel32.SetConsoleMode
is not being checked, although I'm not aware of a situation that would reject that particular call.The user-visible behaviour issue is python-poetry/poetry#3354
The text was updated successfully, but these errors were encountered: