cargo report future-incompatibilities
doesn't check for color support correctly
#9960
Labels
A-console-output
Area: Terminal output, colors, progress bar, etc.
A-future-incompat
Area: future incompatible reporting
C-bug
Category: bug
Problem
cargo report future-incompatibilities
does not check for color support correctly. If you pipe the output to a file or something likeless
, it is not stripping the colors. This wasn't quite the intended behavior in #9606. The issue is here where it only checks if stderr supports color.Steps
cargo report future-incompatibilities > some_file
Notice that
some_file
contains lots of escape charactersPossible Solution(s)
I'm not entirely sure of the best approach to fix this. Perhaps just check if both stdout and stderr support color at the line noted above? I can't imagine a scenario where that would matter. I'd be reluctant to make this too fussy or complicated, though worst case the check to call
strip_ansi_escapes::strip
could be moved to the callers, but I think I'd rather avoid that.Notes
Output of
cargo version
:cargo 1.57.0-nightly (d56b42c 2021-09-27)
The text was updated successfully, but these errors were encountered: