Enable ANSI escape code handling on windows consoles.#2570
Enable ANSI escape code handling on windows consoles.#2570trulede wants to merge 2 commits intogo-task:mainfrom
Conversation
|
Hey @trulede. Were you able to reproduce the problem? If so, how? Which terminal app? |
|
@andreynering I modified the code in the PR to force the condition (clearing the flag), proving the reported behaviour (and thus the solution). But would it solve the issue for the originator? Probably. Still, its not a Task issue. Something in the terminal is wrong of the originators pc. They have indicated as much. Although I don't think there is much risk with this PR, in case the console is not a terminal, the call to GetConsoleMode() will err and nothing else will happen. At least someone else should verify the PR - I suggest forcing the condition, my efforts to reproduce the broken console took a long time and were not effective. Almost certainly, something else is the cause. There could be a task user who does not want this flag set? We could restrict it further, for instance, only setting it if |
Enable ANSI escape code handling on windows consoles.
fixes #2076
This sets the windows terminal so that it handles ANSI codes (esp color). Under some circumstances (not known) a windows console may be in a mode where it does not process ANSI codes, as a result task output (color=true or false) will show escape sequences:
This PR pushes the terminal into the correct mode (ENABLE_VIRTUAL_TERMINAL_PROCESSING).