Skip to content

fix: respect --no-color and NO_COLOR - #1906

Merged
firecow merged 2 commits into
masterfrom
fix/respect-no-color
Jul 31, 2026
Merged

fix: respect --no-color and NO_COLOR#1906
firecow merged 2 commits into
masterfrom
fix/respect-no-color

Conversation

@firecow

@firecow firecow commented Jul 31, 2026

Copy link
Copy Markdown
Owner

The color guard checked argv.noColor, which yargs never sets because --no-color parses to color=false, so disabling color only worked via chalk's own argv sniffing, which FORCE_COLOR overrides and which ignores NO_COLOR entirely.


Summary by cubic

Fixes CLI color handling to respect --no-color and the NO_COLOR env var instead of relying on chalk argv sniffing that FORCE_COLOR can override. Colors disable when --no-color is passed or NO_COLOR is set, and stay enabled otherwise.

  • Bug Fixes
    • Disable color when argv.color === false or process.env.NO_COLOR is non-empty; keep it enabled by default and when NO_COLOR is empty.
    • Add tests for default, --no-color, and NO_COLOR set/empty cases; type the saved chalk level as ColorSupportLevel.

Written for commit fdd2152. Summary will update on new commits.

Review in cubic

The color guard checked argv.noColor, which yargs never sets: --no-color
parses to color=false. It only worked because chalk sniffs process.argv
itself, so FORCE_COLOR overrode it and NO_COLOR was ignored entirely.
@firecow firecow self-assigned this Jul 31, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@sonarqubecloud

Copy link
Copy Markdown

@firecow
firecow merged commit b8b3801 into master Jul 31, 2026
16 checks passed
@firecow
firecow deleted the fix/respect-no-color branch July 31, 2026 14:19
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.

1 participant