Repository navigation
Always use aixterm bright color codes for bright colors - #42
Merged
alexey-milovidov merged 1 commit intoJul 7, 2026
Merged
Conversation
Bright foreground colors (GRAY through WHITE, codes 8-15) were emitted as aixterm bright color codes (90-97) only when TERM contained the substring "256", falling back to bold + dark color (e.g. "\e[0;1;30m" for GRAY) otherwise. The check is misguided: codes 90-97 belong to the basic 16-color set and are unrelated to 256-color support. Meanwhile the fallback breaks on terminals with TERM values like xterm-ghostty, xterm-kitty, alacritty or foot, because modern terminals do not render bold as bright by default: GRAY (bold black) degrades to plain black. In ClickHouse this made the as-you-type autocompletion hints, which default to GRAY, unreadable on dark backgrounds in Ghostty. Emit the bright color codes unconditionally, and update the regression-test escape-sequence mapping accordingly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sdairs
force-pushed
the
fix-bright-colors-term-detection
branch
from
July 7, 2026 10:30
2da04e9 to
93b667e
Compare
alexey-milovidov
approved these changes
Jul 7, 2026
1 task
huldarchen
pushed a commit
to huldarchen/ClickHouse
that referenced
this pull request
Jul 20, 2026
Pulls in ClickHouse/replxx#42: bright foreground colors (GRAY through WHITE) were emitted as aixterm bright color codes (90-97) only when TERM contained the substring "256", falling back to bold + dark color otherwise. Modern terminals do not render bold as bright by default, so on terminals with TERM values like xterm-ghostty, xterm-kitty, alacritty or foot the as-you-type autocompletion hints (GRAY, i.e. bold black under the fallback) were unreadable on dark backgrounds. Related: ClickHouse/replxx#42 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
Pulls in ClickHouse/replxx#42: bright foreground colors (GRAY through WHITE) were emitted as aixterm bright color codes (90-97) only when TERM contained the substring "256", falling back to bold + dark color otherwise. Modern terminals do not render bold as bright by default, so on terminals with TERM values like xterm-ghostty, xterm-kitty, alacritty or foot the as-you-type autocompletion hints (GRAY, i.e. bold black under the fallback) were unreadable on dark backgrounds. Related: ClickHouse/replxx#42 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Bright foreground colors (
GRAYthroughWHITE, codes 8-15) were emitted as aixterm bright color codes (90-97) only whenTERMcontained the substring "256", falling back to bold + dark color (e.g.\e[0;1;30mforGRAY) otherwise.The check is misguided: codes 90-97 belong to the basic 16-color set and are unrelated to 256-color support. Meanwhile the fallback breaks on terminals with
TERMvalues likexterm-ghostty,xterm-kitty,alacrittyorfoot, because modern terminals do not render bold as bright by default:GRAY(bold black) degrades to plain black. In ClickHouse this makes the as-you-type autocompletion hints, which default toGRAY, unreadable on dark backgrounds in Ghostty (while the same build looks fine underTERM=xterm-256color).This change emits the bright color codes unconditionally.
Verified by linking
ansi_colorinto a small harness withTERM=xterm-ghostty:GRAY\e[0;1;30m(bold black)\e[0;90m(bright black)BRIGHTRED\e[0;1;31m\e[0;91mWHITE\e[0;1;37m\e[0;97mRED\e[0;22;31m\e[0;22;31m(unchanged)DEFAULT\e[0m\e[0m(unchanged)🤖 Generated with Claude Code
Backward compatibility
TERMvalues containing "256" (e.g.xterm-256color, the default on desktop Linux terminals since ~2010) — they already received codes 90-97.0in\e[0;9Xmstill resets attributes, so text renders in the default foreground — readable, merely uncolored. The failure mode of the old code was worse: bold black rendered as invisible text on dark backgrounds.is_a_ttybefore emitting attributes, so piped output never contains these sequences.\e[J) are hardcoded ANSI, so this change stays within the library's existing ECMA-48 assumption.