no_color config key is inert; honor it and add a --color flag #171

Closed
opened 2026-06-15 15:01:14 +00:00 by stephen · 0 comments
Owner

Problem

fj config set no_color true is accepted (no_color is in KNOWN_KEYS) but read nowhere; color is decided solely by the supports-color crate (isatty plus NO_COLOR / FORCE_COLOR). The documented setting is a silent no-op, and there is no per-invocation override (e.g. force color into less -R, or strip it where the crate would still colorize).

Acceptance criteria

  • The no_color config value is honored in the color decision.
  • A global --color <auto|always|never> flag overrides config and env (auto = today's behavior).
  • Precedence documented and tested: --color flag > NO_COLOR / FORCE_COLOR env > no_color config > isatty.
  • A test asserts no_color=true suppresses color (guards against re-introducing the dead key).

Value

Correctness (the setting finally works) plus scripting / UX control over color in pipes and pagers.

Priority

p1 (small, low-risk, fixes a latent bug, global).

Dependencies / sequencing

None.

Overlap

None.

## Problem `fj config set no_color true` is accepted (`no_color` is in `KNOWN_KEYS`) but read nowhere; color is decided solely by the `supports-color` crate (isatty plus `NO_COLOR` / `FORCE_COLOR`). The documented setting is a silent no-op, and there is no per-invocation override (e.g. force color into `less -R`, or strip it where the crate would still colorize). ## Acceptance criteria - [ ] The `no_color` config value is honored in the color decision. - [ ] A global `--color <auto|always|never>` flag overrides config and env (`auto` = today's behavior). - [ ] Precedence documented and tested: `--color` flag > `NO_COLOR` / `FORCE_COLOR` env > `no_color` config > isatty. - [ ] A test asserts `no_color=true` suppresses color (guards against re-introducing the dead key). ## Value Correctness (the setting finally works) plus scripting / UX control over color in pipes and pagers. ## Priority p1 (small, low-risk, fixes a latent bug, global). ## Dependencies / sequencing None. ## Overlap None.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rasterstate/fj#171
No description provided.