Fix invisible selection color when a theme has no [colors.selection] - #9287
Open
perryqh wants to merge 3 commits into
Open
Fix invisible selection color when a theme has no [colors.selection]#9287perryqh wants to merge 3 commits into
perryqh wants to merge 3 commits into
Conversation
omarchy-theme-colors-from-alacritty fell back to foreground for selection_background, making it identical to text color and rendering Neovim visual selections, gum prompts, and btop's selected row invisible. Fall back to color8 (bright black, itself falling back to normal black) instead, matching the chain omarchy-theme-color already uses elsewhere. Fixes omacom#9266 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NrpvESUziiQ2ziRhUBvqjZ
The alacritty-derivation fix only changes colors.toml generation going forward. A theme active from before that fix keeps the stale selection == foreground value baked into its materialized colors.toml until something regenerates it, so add a one-time migration that detects that exact fingerprint and calls omarchy-theme-refresh. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NrpvESUziiQ2ziRhUBvqjZ
…ched An extra/git theme whose repo already committed the old generator's selection == foreground fingerprint kept recopying that value forever, since theme-set skips regeneration once colors.toml exists. Repair the staged copy in place before templates are generated. The migration also guards against a current theme that was later removed, since blindly refreshing it would hard-fail and stall every migration queued behind it. The repair only touches the staged copy, not the user's own theme source, which may be a git clone or a symlink into personal dotfiles. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NrpvESUziiQ2ziRhUBvqjZ
perryqh
marked this pull request as ready for review
August 31, 2026 02:00
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.
Screenshots
Before — theme with no

[colors.selection]: selection background equals the foreground color, so selected text is nearly unreadable.After — falls back to

color8instead, so the selection is clearly visible.Summary
omarchy-theme-colors-from-alacrittyfell back toforegroundforselection_backgroundwhen a theme'salacritty.tomlhad no[colors.selection]block, making selections/highlights identical to text color and effectively invisible (Neovim visual mode, gum confirm/choose prompts, btop's selected row). Now falls back tocolor8(bright black, itself falling back to normal black), matching the fallback chainomarchy-theme-coloralready uses elsewhere.omarchy-theme-setnow also repairs that same fingerprint on the staged copy when an extra/git theme's repo already committed acolors.tomlcarrying it — theme-set skips regeneration oncecolors.tomlexists, so such a theme would otherwise recopy the stale value forever no matter how many times it's refreshed. Only the staged copy is rewritten; the user's own theme source (which may be a git clone or a symlink into personal dotfiles) is left untouched, so the repair harmlessly repeats on every switch of an affected theme.omarchy-theme-set's "Theme does not exist" and hard-fail underomarchy-migrate'sset -euo pipefail, stalling every migration queued behind it — so it seeds "Tokyo Night" instead, mirroring the existing1787481315.shmigration.Fixes #9266
Test plan
test/cli: a theme with[colors.bright]but no[colors.selection], and one with neither, never getselection == foregroundin the generatedcolors.tomltest/shell.d/theme-staging-test.sh: an extra/git theme with a baked-in stalecolors.tomlis repaired tocolor8(falling back tocolor0) on the staged copy, with the source left untouched; a healthy or official palette is never rewrittentest/shell.d/theme-selection-color-migration-test.sh: the migration refreshes an affected theme, leaves a healthy one alone, no-ops with no current theme, and — run against the realomarchy-migrate— does not stall the migration queue when the current theme was removed ortheme.nameis missing./test/cliand./test/shellpass./test/allshows no new failures (4 pre-existing failures onquattrounrelated to this change, reproduced independently with these commits removed:config-test.sh,snapper-test.sh,theme-install-guards-test.sh,unowned-system-paths-test.sh)alacritty.tomllacking[colors.selection], confirmed the generatedselectiondiffered fromforeground, and checked Alacritty/Neovim/gum/btop selection highlights were visible before reverting to the original theme