Whether this is just some strange interaction between colorama and the script command used in the test, or a bug in colorama, I'm not sure.
N.B. I had a look at how colorama works. It bills itself as a package meant only for making colour work on Windows, but I guess we are using it for its init(strip=not use_color) function that can automatically strip ANSI color chars from print() calls (it actually patches sys.stdout and sys.stderr). However there are >100 open issues and it is in a call-for-maintainers state: https://github.com/tartley/colorama/issues/300.
There is a problem with this test https://github.com/cylc/cylc-flow/blob/ca454d0032aed567c7913a3f47307c6e5dcaef26/tests/functional/cli/05-colour.t#L34-L35
A color reset char is included on the last line of the output:
This is despite
autoreset=False
anduse_color=False
(strip=True
) here: https://github.com/cylc/cylc-flow/blob/ca454d0032aed567c7913a3f47307c6e5dcaef26/cylc/flow/terminal.py#L292Whether this is just some strange interaction between
colorama
and thescript
command used in the test, or a bug incolorama
, I'm not sure.N.B. I had a look at how colorama works. It bills itself as a package meant only for making colour work on Windows, but I guess we are using it for its
init(strip=not use_color)
function that can automatically strip ANSI color chars fromprint()
calls (it actually patchessys.stdout
andsys.stderr
). However there are >100 open issues and it is in a call-for-maintainers state: https://github.com/tartley/colorama/issues/300._Originally posted by @MetRonnie in https://github.com/cylc/cylc-flow/pull/6463#discussion_r1832904014_