Skip to content

Default cliamp to ANSI and require explicit native-theme opt-in - #4

Merged
OldJobobo merged 2 commits into
OldJobobo:thpmfrom
HANCORE-linux:cliamp-native-or-ansi
Jun 22, 2026
Merged

Default cliamp to ANSI and require explicit native-theme opt-in#4
OldJobobo merged 2 commits into
OldJobobo:thpmfrom
HANCORE-linux:cliamp-native-or-ansi

Conversation

@HANCORE-linux

Copy link
Copy Markdown

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 accent field, 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.toml appeared 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.

  • Themes use cliamp's ANSI default through theme = "". No omarchy.toml is generated, and a running cliamp can follow changes to the terminal palette 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 treated as author intent because these files may be generated automatically.
  • Opted-in native themes are canonicalised before installation: inline comments are removed, #RGB is expanded to #RRGGBB, and CRLF files are supported.
  • Required write failures return non-zero without reporting success, and stale omarchy.toml files 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.

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.
@OldJobobo
OldJobobo merged commit c5dd15c into OldJobobo:thpm Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants