From 0adbf6b032dfedf31717630873d751f10cab02c2 Mon Sep 17 00:00:00 2001 From: FrozenPandaz Date: Thu, 19 Feb 2026 15:22:37 -0500 Subject: [PATCH] fix(core): handle FORCE_COLOR=0 with picocolors 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 nrwl/nx#34387 --- packages/nx/bin/nx.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/nx/bin/nx.ts b/packages/nx/bin/nx.ts index 2cf7ea2b5e0..6541eb01fe7 100644 --- a/packages/nx/bin/nx.ts +++ b/packages/nx/bin/nx.ts @@ -1,4 +1,12 @@ #!/usr/bin/env node + +// TODO: Remove this workaround once picocolors handles FORCE_COLOR=0 correctly +// See: https://github.com/alexeyraspopov/picocolors/issues/100 +if (process.env.FORCE_COLOR === '0') { + process.env.NO_COLOR = '1'; + delete process.env.FORCE_COLOR; +} + import { findWorkspaceRoot, WorkspaceTypeAndRoot,