Fix selected row contrast on light terminal themes - #124
Open
lucamarra-bee wants to merge 1 commit into
Open
Conversation
SELECTED_BG hardcoded a dark 256-color gray (238) and HIGHLIGHT used bold yellow tuned for dark backgrounds. On light themes (e.g. Ghostty's Melange Light), the yellow foreground has very low contrast against that forced dark background, making the current row's match text nearly invisible. Switch SELECTED_BG to reverse video (\e[7m), which swaps whatever foreground/background colors the terminal is already using instead of assuming a dark theme. Drop the fixed yellow from HIGHLIGHT in favor of bold-only, so the fuzzy-match emphasis doesn't reintroduce the same fixed-color contrast problem on top of the reversed background.
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.
Summary
SELECTED_BGwas hardcoded to a dark 256-color gray (\e[48;5;238m), andHIGHLIGHTused bold yellow — a combination tuned for dark terminal themes.try's hardcoded dark selected-row background, it becomes nearly unreadable — the current row's fuzzy-match text disappears.SELECTED_BGto reverse video (\e[7m), which swaps whatever fg/bg the terminal is already using instead of assuming dark. Dropped the fixed yellow fromHIGHLIGHTin favor of bold-only, so the match emphasis doesn't reintroduce the same fixed-color contrast problem on top of the reversed background.Test plan
ruby -c lib/tui.rbtryinteractively with a light terminal theme (Ghostty Melange Light) — selected row and fuzzy match are now clearly readable