Skip to content

fix(colors): stop defaulting to the unknown color name 'gray' - #594

Open
z1pp090 wants to merge 1 commit into
sirmalloc:mainfrom
z1pp090:fix/gray-default-color
Open

z1pp090 wants to merge 1 commit into
sirmalloc:mainfrom
z1pp090:fix/gray-default-color

Conversation

@z1pp090

@z1pp090 z1pp090 commented Sep 20, 2026 •

Copy link
Copy Markdown

Fixes #540.

Problem

gray is not a COLOR_MAP entry (the neutral one is brightBlack, src/utils/colors.ts:29), and getColorAnsiCode returns '' on a lookup miss. Every site that fell back to 'gray' therefore rendered with no color at all:

  • src/utils/renderer.ts — let separatorColor = widget.color ?? 'gray', the default path for every separator with no explicit color while inheritSeparatorColors is off (the shipped default line has three of them).
  • getDefaultColor() of GitSha, TerminalWidth and Version.

The Ink <Text color='gray'> usages inside the TUI are unrelated: Ink resolves that name itself.

Fix

Swap the four sites to brightBlack. No new color name is introduced, so saved settings and the color menu are unaffected.

Tests

src/utils/__tests__/default-colors.test.ts:

  • every widget in WIDGET_MANIFEST returns a default color that exists in COLOR_MAP (fails on main with git-sha -> 'gray');
  • a separator with no color is rendered with the bright-black SGR code instead of bare (fails on main: | comes out uncolored).

bun test and bun run lint green.

🤖 Generated with Claude Code

`gray` is not a COLOR_MAP entry, and getColorAnsiCode returns '' on a
lookup miss, so every site that fell back to it rendered with no color:
the default separator path in the renderer and the default color of the
Git SHA, Terminal Width and Version widgets. Use `brightBlack`, the
neutral entry the map actually has.

The Ink `<Text color='gray'>` usages in the TUI are untouched; Ink resolves
that name itself.

Closes sirmalloc#540

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01StkifHpSLWH4J5TvuP56ur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The 'gray' color name resolves to nothing, including on the default separators

1 participant