Skip to content

Comments

fix(core): handle FORCE_COLOR=0 with picocolors#34520

Open
FrozenPandaz wants to merge 2 commits intomasterfrom
fix/force-color-zero-picocolors
Open

fix(core): handle FORCE_COLOR=0 with picocolors#34520
FrozenPandaz wants to merge 2 commits intomasterfrom
fix/force-color-zero-picocolors

Conversation

@FrozenPandaz
Copy link
Collaborator

Current Behavior

After migrating from chalk to picocolors (#34305), FORCE_COLOR=0 no longer disables colors. picocolors checks !!env.FORCE_COLOR, and since !!"0" is true in JavaScript, it treats FORCE_COLOR=0 as "enable colors."

This breaks CI environments and tools like Homebrew that set FORCE_COLOR=0 to get plain text output.

Expected Behavior

FORCE_COLOR=0 should disable ANSI color output, matching the previous chalk behavior and the FORCE_COLOR spec.

Related Issue(s)

Fixes #34387

Upstream issue filed: alexeyraspopov/picocolors#100

picocolors treats FORCE_COLOR=0 as truthy, enabling colors instead of
disabling them. This differs from chalk's behavior where FORCE_COLOR=0
means "disable colors." Convert FORCE_COLOR=0 to NO_COLOR=1 before
picocolors initializes.

Fixes #34387
@FrozenPandaz FrozenPandaz requested a review from a team as a code owner February 19, 2026 20:22
@netlify
Copy link

netlify bot commented Feb 19, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 2f19f1d
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69987f83c942f20008343584
😎 Deploy Preview https://deploy-preview-34520--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 19, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 2f19f1d
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69987f83c6837f00099782ca
😎 Deploy Preview https://deploy-preview-34520--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Feb 19, 2026

View your CI Pipeline Execution ↗ for commit 2f19f1d

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 14m 56s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 4m 1s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 9s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-20 15:56:56 UTC

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.

nx test still emits ANSI codes with FORCE_COLOR=0 in CI

1 participant