Add opt-in selectedLineFgColor theme option - #839
Open
0x3654 wants to merge 1 commit into
Open
Conversation
The selected line is a background colour plus a force-brightened, emboldened foreground (gocui's setRune ignores View.SelFgColor), which washes out on dark palettes (jesseduffield#543), and the only built-in escape, reverse, inverts status colours along with everything else. Add an opt-in selectedLineFgColor theme key: when set, the whole selected line renders uniformly in that colour (plain cells keep the classic bold emphasis, per-cell colours such as container status are overridden). Unset by default: rendering is unchanged. Ignored when the selection style contains reverse, because an explicit foreground would land on a terminal-theme-dependent colour after the terminal swaps fg/bg. Includes the vendored gocui change honouring SelFgColor in setRune, to be re-vendored from upstream once it lands there. Fixes jesseduffield#543 Refs jesseduffield#393, jesseduffield#685 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.
Fixes #543
Refs #393, #685
Why
Since #372 (2022) the selected line is a coloured background with the cell's
own foreground force-brightened and emboldened by gocui. Two long-standing
complaints follow from that:
bluebackground plus bright default textwashes out — selectedLineBgColor always uses bright colours; default theme is illegible in white-on-black terminals #543 (open since 2024), [FR] Make missing more visible. dark blue on black suboptimal #685 (2025), Change selected background color like lazygit #393 (2022, zero replies);
reverse, inverts the whole row including statuscolours, which turns
running's green into an unreadable olive — it tradescontrast for semantics.
There is no knob for the selected line's foreground: the theme exposes a
background only. gocui's
View.SelFgColorexists but is ignored by the maindraw path, so lazydocker could not expose one even if it wanted to.
A default can't fix this — so this PR doesn't change one
ANSI colours are defined by the terminal palette, and palettes disagree:
selectedLineBgColor: [blue]palette 4 = #f38d70)Any new default would be a lottery across themes. So the new key is strictly
opt-in: unset by default, and with it unset this PR changes nothing —
rendering is byte-identical to current master. Users who want a uniform,
predictable selection style opt in with one line and pair it with a background
that fits their palette.
What it does
When set, the whole selected line renders uniformly in that colour:
overridden, so the row reads as one plate instead of mixed bright colours
on a coloured background;
GetGocuiStylemachinery;reverse, the key is ignored and the classicinverted look is kept (an explicit fg under
reversewould land on aterminal-theme-dependent colour after the swap).
Requires the companion gocui change (honour
View.SelFgColorinsetRune):jesseduffield/gocui#107
Screenshots
Six shots, one config (
selectedLineBgColor: blue,selectedLineFgColor: black),two terminals — the palette decides everything.
stock
Terminal.app (classic ANSI blue) — bright text on navy, the #543 wash-out:
Ghostty, Monokai Pro Ristretto — the same
bluerenders salmon: the palette lottery:reverse— the existing workaroundTerminal.app — contrast is back, but status colours are inverted into mush:
Ghostty — the same destruction, inverted differently:
this PR,
fg: blackTerminal.app — a pair that doesn't fit this palette: pick pairs consciously:
Ghostty — uniform black on salmon: the plate this PR enables:
Same key, same config line — readable or broken depending on the terminal.
That is why this PR adds a knob instead of changing a default.