Can you have subprocesss.Popen retain color in stdout/stderr?
You do not specify whan cmd
is, but some programs do not emit the escape sequences necessary for color output on a terminal when they determine that their standard output is not actually connected to a terminal.
Depending on the program you may or may not be able to override that.
With ansible
, you can set the force_color
configuration variable to 1 to force color output.