Repository navigation
Conversation
View exposes both SelBgColor and SelFgColor, but the per-rune draw path only ever applies SelBgColor: the foreground is force-brightened (the +8 variant of the cell's own colour) and emboldened, and SelFgColor is silently ignored (it is currently only honoured by SetHighlight, which list-style consumers don't use). Consumers therefore can't offer a readable "dark text on a bright selection background" style: the brightening fights it. Apply SelFgColor in setCharacter when it is set: every cell of the selected line takes the selected foreground, plain cells (no colour of their own) keep the classic bold emphasis, coloured cells render regular weight. If either selection attribute carries reverse, keep the legacy behaviour: reverse swaps fg/bg at the terminal, so an explicit foreground would land on a terminal-theme-dependent colour after the swap. With SelFgColor unset (the default), rendering is unchanged. Co-Authored-By: Claude Code <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.
Honour View.SelFgColor for the highlighted line in setRune
Viewexposes bothSelBgColorandSelFgColor, but the per-rune draw path(
setRune) only ever appliesSelBgColor: the foreground is force-brightened(the +8 variant of the cell's colour) and emboldened, and
SelFgColorissilently ignored (
SelFgColoris currently only honoured bySetHighlight,which list-style consumers don't use). Consumers therefore can't offer a
readable "dark text on a bright selection background" style: the brightening
fights it.
This makes
setRuneapplySelFgColorwhen it is set:its own colour — the line renders as a uniform plate;
coloured cells render regular weight;
reverse, the legacy behaviour iskept:
reverseswaps fg/bg at the terminal, so an explicit foreground wouldland on a terminal-theme-dependent colour after the swap;
SelFgColoris unset (the default), rendering is unchanged.Covered by
TestSetCharacterSelection, which drivessetCharacterthrough a headless (simulation-screen) Gui and asserts the final tcell
style of the selected cell; it fails on master.
Companion consumer PR: jesseduffield/lazydocker #839 adds an opt-in
selectedLineFgColortheme key on top of this.