-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Problem
cargo report future-incompatibilities does not check for color support correctly. If you pipe the output to a file or something like less, 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 characters
Possible 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)