Skip to content

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

Merged
FrozenPandaz merged 3 commits intomasterfrom
fix/force-color-zero-picocolors
Feb 25, 2026
Merged

fix(core): handle FORCE_COLOR=0 with picocolors#34520
FrozenPandaz merged 3 commits intomasterfrom
fix/force-color-zero-picocolors

Conversation

@FrozenPandaz
Copy link
Copy Markdown
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
Copy Markdown

netlify bot commented Feb 19, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 0719d71
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/699c9eeeb1903e0008799ca1
😎 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
Copy Markdown

netlify bot commented Feb 19, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 0719d71
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/699c9eee008ece0008da1d45
😎 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
Copy Markdown
Contributor

nx-cloud bot commented Feb 19, 2026

View your CI Pipeline Execution ↗ for commit 0719d71

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 46m 16s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3m 22s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 8s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-23 19:37:19 UTC

@FrozenPandaz FrozenPandaz merged commit f31e7a7 into master Feb 25, 2026
23 checks passed
@FrozenPandaz FrozenPandaz deleted the fix/force-color-zero-picocolors branch February 25, 2026 20:47
FrozenPandaz added a commit that referenced this pull request Feb 26, 2026
## 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](https://force-color.org/).

## Related Issue(s)

Fixes #34387

Upstream issue filed:
alexeyraspopov/picocolors#100

(cherry picked from commit f31e7a7)
FrozenPandaz added a commit that referenced this pull request Feb 26, 2026
## 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](https://force-color.org/).

## Related Issue(s)

Fixes #34387

Upstream issue filed:
alexeyraspopov/picocolors#100

(cherry picked from commit f31e7a7)
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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

2 participants