Skip to content

[cross-cutting] [P2] No --no-color flag (NO_COLOR works only via Rich's tty auto-detection) #567

Description

@zhenchaoni

Severity: P2
Command: cross-cutting


Category: Color & Theming — color must be controllable both per-invocation (flag) and per-environment (env var).

Repro:

uv run winml --help        | Select-String 'no-color'
uv run winml export --help | Select-String 'no-color'
$env:NO_COLOR='1'; uv run winml sys --format compact > out.txt 2>&1; Remove-Item Env:NO_COLOR
Get-Content out.txt -Raw | Select-String -Pattern '\x1b\['

Actual:

  • No --no-color flag exists in winml --help or any subcommand.
  • NO_COLOR=1 does suppress ANSI in piped output (verified — 0 escape sequences in capture). This works because Rich auto-detects no-tty / NO_COLOR.
  • But there is no per-invocation flag, so a user running interactively in a terminal cannot disable color without setting an env var.

Expected: Add a top-level --no-color flag that sets the Rich Console(no_color=True, force_terminal=False) for the rest of the run. Document NO_COLOR=1 and CI=true in the help epilog. Do not regress the current Rich auto-detection.

Why it matters: Some terminals (older Windows consoles, log viewers, screen-reader sessions) render the color codes as garbage. A per-invocation flag is the standard escape hatch.

Metadata

Metadata

Labels

P2Medium — minor bug or non-critical improvementbugSomething isn't workingdev experienceDeveloper experience improvementsqualityUse for quality control related issuestriagedIssue has been triaged

Type

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions