This repository has been archived by the owner on May 2, 2019. It is now read-only.
Keep colored output for --color=auto
on Windows
#3
Labels
--color=auto
on Windows
#3
Since there is no
termios
module on Windows, there is no way to emulate a terminal, which means when using--color=auto
option, we cannot tricksubprocess
to think that it is connected to a terminal instead of a pipe. Thus, with--color=auto
option, there will be no colored output.This trick is essential for
--color=auto
or-G
for BSD.One way to force colored output is to replace
--color=auto
with--color=always
, however this will have undesired consequences when using a pipe or redirecting to a file. We can try to detect ifos.stdout
is a terminal or not. However the current solution also usestermios
.Any input is welcome.
The text was updated successfully, but these errors were encountered: