fix(terminal): dimmed text on a filled background no longer renders invisible - #279
Closed
vakovalskii wants to merge 1 commit into
Closed
fix(terminal): dimmed text on a filled background no longer renders invisible#279vakovalskii wants to merge 1 commit into
vakovalskii wants to merge 1 commit into
Conversation
…nvisible Claude Code (and other TUIs) draw some rows as *dimmed* text on a filled background — e.g. the grey 'message above' bars. In a codbash pane those bars came out as empty grey strips with no text at all, while the same output stayed legible in iTerm. Cause: xterm's minimumContrastRatio defaults to 1, which disables all contrast adjustment — and the dim path is gated behind it (xterm.js: 'minimumContrastRatio||(0…)' and 'minimumContrastRatio/(s.isDim(…)'). The WebGL renderer applies dim by cutting the foreground alpha, so with no adjustment dim-on-background washes out to invisible. Both the webgl and canvas addons honor the option. Fix: set minimumContrastRatio to 4.5 (WCAG AA). xterm only nudges a foreground when it falls below the ratio, so normal colors are untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vakovalskii
added a commit
that referenced
this pull request
Jul 30, 2026
* fix(terminal): dimmed text on a filled background no longer renders invisible Claude Code (and other TUIs) draw some rows as *dimmed* text on a filled background — e.g. the grey 'message above' bars. In a codbash pane those bars came out as empty grey strips with no text at all, while the same output stayed legible in iTerm. Cause: xterm's minimumContrastRatio defaults to 1, which disables all contrast adjustment — and the dim path is gated behind it (xterm.js: 'minimumContrastRatio||(0…)' and 'minimumContrastRatio/(s.isDim(…)'). The WebGL renderer applies dim by cutting the foreground alpha, so with no adjustment dim-on-background washes out to invisible. Both the webgl and canvas addons honor the option. Fix: set minimumContrastRatio to 4.5 (WCAG AA). xterm only nudges a foreground when it falls below the ratio, so normal colors are untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(terminal): name a terminal pane yourself The pane title bar showed only an auto-label — the running agent, the project folder, or a bare '~' for home. With several panes open in the same folder (or several shells in $HOME) they were indistinguishable. You can now give a pane its own name: click the ✎ in its title bar, or double-click the title. An empty answer clears the name and restores the auto-label. Uses codbashPrompt (window.prompt is a no-op in the Electron shell). The name round-trips: it is captured into the session snapshot and saved layouts, restored at every pane-construction site, and sanitizePane now preserves it (reusing the existing MAX_NAME=120 cap and rejecting control characters, like the other pane fields). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * release: 7.17.0 — named terminal panes + readable dimmed text Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Симптом
В панели Terminal строки, которые Claude Code рисует приглушённым текстом на залитом фоне (серые полосы «сообщение выше»), выглядели как пустые серые полосы вообще без текста. Тот же самый вывод в iTerm читается нормально — то есть текст не терялся, а не отрисовывался.
Репортил @vakovalskii, воспроизводится повсеместно, а не в каком-то одном месте.
Причина
Найдена в вендоренном xterm.js:
Коррекция контраста целиком закрыта за этой опцией, а её дефолт —
1, то есть выключено. Мы её не выставляли. WebGL-рендерер реализуетdimчерез срез альфы переднего плана, поэтому без коррекции приглушённый текст на залитом фоне схлопывается до неразличимого. iTerm приглушает мягче, отсюда разница.Оба наших аддона опцию учитывают:
addon-webgl.jsиaddon-canvas.jsссылаются на неё и активно работают сdim(21 и 13 упоминаний соответственно).Фикс
Одна строка —
minimumContrastRatio: 4.5(WCAG AA) в опцияхTerminal. xterm правит цвет только когда контраст падает ниже порога, поэтому обычные цвета темы не затрагиваются.Проверка
node --test test/*.test.js→ 253 passed / 0 failed / 2 skippednode bin/cli.js runна этой ветке → вкладка Terminal → запустить агента и прокрутить историю; серые полосы должны показывать текст.Отдельно отмечу: в ходе разбора я сначала ошибочно списал это на служебную обёртку
<local-command-caveat>в транскрипте (она действительно рисуется как пустой серый бокс, но только у!-команд) — сообщение @vakovalskii «такое у меня везде» это опровергло и вывело на настоящую причину.🤖 Generated with Claude Code