Fall back to color8 for a derived theme selection color - #9270
Open
DeanWahle wants to merge 1 commit into
Open
Conversation
A theme with an alacritty.toml but no [colors.selection] had its generated colors.toml written with selection equal to foreground, making every selection and highlight invisible text-on-text. Use the same fallback chain omarchy-theme-color already applies for an unset selection: color8, then color0, then background. Fixes omacom#9266
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.
Symptom
A theme installed with
omarchy theme installthat ships only analacritty.tomlwith no[colors.selection]block ends up withselectionequal toforegroundin its generatedcolors.toml. Every highlight that keys off that value renders as invisible text-on-text: Neovim'sVisualandLspReferenceText, the selected item ingum confirm/gum chooseprompts, and btop's selected process row.Root cause
bin/omarchy-theme-colors-from-alacrittydefaulted an absent selection background to the foreground:selection_background=${selection_background:-$foreground}Because the theme now has a
colors.toml,omarchy-theme-color's own fallback chain for an unsetselectionnever gets a chance to run. The key is already set, just set to the one value it should never take.Fix
Use the same chain
omarchy-theme-colorapplies atbin/omarchy-theme-color:229for an unset selection, so the generator and the reader agree:selection_background=${selection_background:-${color8:-${color0:-$background}}}color8is[colors.bright].black, or[colors.normal].blackwhen the theme ships no bright palette. The normal colors are validated earlier in the script, socolor8is always set by the time this runs; the rest of the chain mirrors the canonical one rather than stopping short of it.A theme that does declare
[colors.selection]is unaffected.Verified
Locally on bash 5.3, running the script directly against synthetic theme directories:
[colors.selection]generatedselection = "#c0caf5", identical to itsforeground.selection = "#414868", itscolor8.[colors.selection].backgroundstill gets exactly that value.[colors.bright]gets its[colors.normal].black, confirming the chain followscolor8rather than reaching the foreground.test/shell.d/theme-colors-from-alacritty-test.shcovering those three cases. It fails on the unfixed script withexpected: #414868 / actual: #c0caf5and passes with the fix, so it is a real regression test rather than a restatement of current behavior.bash -non both changed files, andtest/shell.d/bin-style-test.shpasses.theme-install-guards-test.sh,user-theme-test.shandvscode-theme-test.shpass.Not verified
I do not have an Omarchy system to test on, so this was not exercised through a real
omarchy theme installoromarchy theme set, and I did not confirm the downstream rendering in Neovim, gum or btop; that part rests on the issue reporter's account and on the generatedcolors.tomlnow carrying the intended value.test/shell.d/theme-staging-test.shfails on my macOS checkout, but it fails identically on unmodifiedquattro, so it is an environment limitation rather than a regression from this change. I also could not complete a fulltest/shellrun locally: unrelated Linux-dependent files hang partway through on macOS.