When --color=false ensure no ANSI codes are printed. #2584
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When cli arg
--coloris set to false the Task logging will still print ANSI codes (the reset code). This is probably not the intended behaviour!?! Most often this is observed in situations where ANSI codes are not interpreted by a terminal emulation (i.e. logging, some UI situations (#2560).For further clarity:
--color=falsewill turn color off, overpowering FORCE_COLOR.This PR is introducing
Noneas a log color, which explicitly callsDisableColor()in/on a Color object from fatih/color, and its set when CLI option--coloris false.Helps to fix #2560