tox
tox copied to clipboard
ConsoleZ does not show report colors
When tox4 is executed from PowerShell (5) on Windows (10), the color output from mypy/pytest is not displayed correctly. The same issue is also observed when using CMD. On the same environment running tox 3 produces output as expected.
Here is an example (tox4):
tox3 example:
The final message is displayed correctly (tox4):
This problem is not limited to Windows and its caused by loss of tty
status when tox is run. For example it also affects ansible and docker command lines.
@ssbarnea no this is something different. What you're talking about is handled by https://github.com/tox-dev/tox/issues/1773. The part I'm missing here is why is [35m
displayed above in the terminal rather than rendered as color.
@margars please post the project you're using to replicate this and the terminal (with version) you're running in.
Initially I observed the issue with ConsoleZ, but later I tried using Windows default PowerShell and CMD, in all cases the output is not displayed correctly. My project is restricted by company policies, cannot post it.
I marked this one hard, because doing true pty emulation on Windows is not a well trod path.
However, it might be possible to use the tox3 behavior of not passing file handles to subprocess stdout/stderr. Normally, this would break command logging, but maybe instead some windows-specific API might be used to read/spy the child process console streams, so they wouldn't have to be redirected at the subprocess layer. This kind of implementation could be simpler than pty if logging output is the only reason to have pty emulation.