fix(core): handle FORCE_COLOR=0 with picocolors#34520
Merged
FrozenPandaz merged 3 commits intomasterfrom Feb 25, 2026
Merged
Conversation
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
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit 0719d71
☁️ Nx Cloud last updated this comment at |
AgentEnder
approved these changes
Feb 25, 2026
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)
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Current Behavior
After migrating from chalk to picocolors (#34305),
FORCE_COLOR=0no longer disables colors. picocolors checks!!env.FORCE_COLOR, and since!!"0"istruein JavaScript, it treatsFORCE_COLOR=0as "enable colors."This breaks CI environments and tools like Homebrew that set
FORCE_COLOR=0to get plain text output.Expected Behavior
FORCE_COLOR=0should 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