Skip to content

Conversation

@trulede
Copy link
Contributor

@trulede trulede commented Dec 16, 2025

When cli arg --color is 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:

  • FORCE_COLOR will turn color on
  • NO_COLOR will turn color off via the fatih/color module
  • --color=false will turn color off, overpowering FORCE_COLOR.

This PR is introducing None as a log color, which explicitly calls DisableColor() in/on a Color object from fatih/color, and its set when CLI option --color is false.

Helps to fix #2560

@andreynering andreynering changed the title When --color=false ensure no ANSI codes are printed. fix: ensure no ansi sequences are printed for --color=false Jan 18, 2026
Copy link
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@andreynering andreynering merged commit b9c1ab8 into go-task:main Jan 18, 2026
13 checks passed
andreynering added a commit that referenced this pull request Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zsh completion emits ANSI color codes when FORCE_COLOR=1 is set

2 participants