Skip to content

[Bug] Global --no-color flag is a no-op for all commands #263

Description

@404-Page-Found

Summary

The global --no-color option is registered on the root command but is still not consumed by the main CLI. Current command output continues to use picocolors without honoring the flag.

The issue was previously closed as not planned, but the same behavior remains in current main.

Location

  • src/index.ts — .option('--no-color', 'Disable colored output')
  • src/commands/completion.ts — the only current consumer checks argv directly for completion and help generation

Steps to Reproduce

  1. Run commit-echo --no-color suggest in a color-capable terminal.
  2. Capture stdout and stderr.
  3. Inspect the output for ANSI escape sequences.

Expected Behavior

--no-color should disable ANSI styling across all CLI commands.

Actual Behavior

The flag is parsed by Commander but does not change the global picocolors behavior, so commands such as suggest, history, init, and batch can still emit color sequences.

Suggested Fix

After parsing the root options, wire program.opts().noColor into the global color configuration and add end-to-end coverage across representative commands.

Impact

Plain-output users, CI and log consumers, and scripts that explicitly request --no-color still receive terminal escape sequences. The CLI global output-control flag is therefore unreliable.

Reviewed again against current main at 131c914195ec863197197eec024558012c03240d659 on September 25, 2026.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workinggood first issueGood for newcomersp1High priority; blocks core functionality

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions