Default cliamp to ANSI and require explicit native-theme opt-in - #4
Merged
Merged
Conversation
The hook reduced Omarchy's 16-colour terminal palette to cliamp's six custom theme fields. cliamp maps the title, accent, seek bar and key-hint background to the same `accent` field, whereas its ANSI default assigns those roles separate terminal colours. The reduction produced washed-out or overly bright colours in some themes; deleting the generated omarchy.toml appeared to fix it only because cliamp then fell back to its ANSI default, and the next theme switch regenerated the file. Stop deriving a custom palette: - Themes use cliamp's ANSI default via `theme = ""`. No omarchy.toml is generated, and a running cliamp can follow terminal-palette changes without reloading a cached custom theme. - A theme-provided cliamp.toml is installed only when it contains the exact opt-in line `# thpm:cliamp-use-native`. File existence alone is not author intent, since these files may be generated automatically. - Opted-in native themes are canonicalised before install: inline comments removed, `#RGB` expanded to `#RRGGBB`, CRLF supported. - Required write failures return non-zero without reporting success, and a stale omarchy.toml is removed only when its first line exactly matches the hook's ownership marker. Adds regression coverage for the ANSI path, native canonicalisation, missing and near-miss opt-in markers, incomplete native themes, CRLF input, ownership-marker exactness and config write failures. The repo suite (stub cliamp) passes; native-theme acceptance was verified separately against the real cliamp binary via `cliamp theme list`.
cliamp v1.57.1 tolerates inline comments in theme files; only older builds fold a comment into the value and reject the theme. Reword the hook and test comments accordingly. Canonicalising stays justified (older builds, #RGB normalisation, clean output). Comment-only change, no behaviour change.
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.
Why
The existing hook reduces Omarchy's 16-colour terminal palette to cliamp's six custom theme fields. However, cliamp maps the title, accent, seek bar and key-hint background to the same
accentfield, while its ANSI default assigns those roles separate terminal colours.This produced washed-out or overly bright colours in some themes. Deleting the generated
omarchy.tomlappeared to fix the issue only because cliamp then fell back to its ANSI default; the next theme switch regenerated the file.What
The hook no longer derives a custom palette.
theme = "". Noomarchy.tomlis generated, and a running cliamp can follow changes to the terminal palette without reloading a cached custom theme.cliamp.tomlis installed only when it contains the exact opt-in line# thpm:cliamp-use-native. File existence alone is not treated as author intent because these files may be generated automatically.#RGBis expanded to#RRGGBB, and CRLF files are supported.omarchy.tomlfiles are removed only when their first line exactly matches the hook's ownership marker.Tests
Adds regression coverage for the ANSI path, native canonicalisation, missing and near-miss opt-in markers, incomplete native themes, CRLF input, ownership-marker exactness and configuration write failures.
The repository suite passes all 453 assertions. Native-theme acceptance was also verified separately against the real cliamp binary using
cliamp theme list.Notes
No currently audited theme contains the opt-in marker, so existing themes use cliamp's ANSI default.