[FEATURE] Status line: pass ANSI colors through instead of forcing dimColor on all content

Resolved 💬 6 comments Opened Apr 2, 2026 by ordinalser Closed May 16, 2026

Preflight

  • [x] I have searched for existing feature requests that match my proposal
  • [x] This request contains only a single feature (not a bundle of features)

Problem Statement

The statusLine command feature lets users run custom scripts to display contextual info in the status bar. The <Ansi> component inside StatusLine.tsx correctly parses ANSI escape codes into native Ink <Text> elements with proper color/style props — this infrastructure works great.

However, the outer wrapper applies dimColor to all child content:

<Text dimColor wrap="truncate">
  <Ansi>{statusLineText}</Ansi>
</Text>

dimColor calls chalk.dim() on the entire output, which overrides every color the <Ansi> component just parsed. The result: all status line text renders as uniform dim gray regardless of what the user's script outputs.

This means the ANSI parsing work inside <Ansi> is effectively wasted for status line scripts — the colors are correctly parsed then immediately discarded by the parent.

Proposed Solution

Move dimColor from the outer <Text> into the <Ansi> component, and apply dim only to spans with no explicit foreground color. This preserves the subdued look for plain text while respecting user-specified colors.

StatusLine.tsx (~1 line):

- <Text dimColor wrap="truncate">
-   <Ansi>{statusLineText}</Ansi>
+ <Text wrap="truncate">
+   <Ansi dimColor>{statusLineText}</Ansi>
  </Text>

Ansi.tsx — make dimColor color-aware (~1 line):

- if (dimColor) {
+ if (dimColor && !span.props.color) {
    span.props.dim = true;
  }

Behavior:

  • Scripts outputting plain text → still dimmed (no visual change from today)
  • Scripts outputting ANSI-colored text → colors render faithfully
  • Zero breaking change for existing users

Priority

Medium

Feature Category

Interactive mode (TUI)

Alternative Solutions

  1. Remove dimColor entirely — but plain text status lines would become too visually prominent
  2. Add a config flag statusLine.allowColors — unnecessary complexity; the proposed fix is inherently backward-compatible

Use Case Example

A status line script outputs git branch (green), dirty file count (yellow), and model name (cyan):

\033[32mmain\033[0m │ \033[33m3 modified\033[0m │ \033[36mOpus 4\033[0m

Today: everything renders as dim gray — the colors are parsed by <Ansi> then overridden by <Text dimColor>.

After this change: colored segments display as intended; the separators (no explicit color) remain appropriately dimmed.

Additional Context

  • The <Ansi> component already supports a dimColor prop — no new API needed, just different wiring
  • ~3 lines changed, no new dependencies
  • Related community discussions: #6466, #16514, #25366 (15 upvotes, 8 duplicates), #8832
  • Similar accessibility fix #4553 (dark mode colors) was successfully resolved

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗