cargo build
respects NO_COLOR=1
but cargo test
does not
#15343
Labels
cargo build
respects NO_COLOR=1
but cargo test
does not
#15343
Problem
I was adding
NO_COLOR
support to our code and noticed thatcargo build
respectsNO_COLOR=1
butcargo test
does not e.g.:But:
Steps
cargo new repro --lib
NO_COLOR=1 cargo build
NO_COLOR=1 cargo test
Possible Solution(s)
No response
Notes
I appreciate there are lots of well-known/used environment variables that amount to the same thing e.g.,
FORCE_TTY
, and I'm not advocating to support them all. It's just not possible. But it would be nice to support the onescargo
already does consistently.Looking at some other bugs, I see you're using
isatty
for detection and that does seem to work in most cases e.g., piping tomore
. But if someone wanted to redirect output to a PTY e.g., in their own wrappers, they might still want a way to force color off since VT sequences may not be supported.Version
The text was updated successfully, but these errors were encountered: