feat(terminal): first-class Ghostty + Termux support; adopt upstream AAA palette - #107
Merged
Merged
Conversation
…AAA palette Make terminal emulators first-class in Potions: Ghostty (Linux/macOS) and Termux (Android), with live theme rotation and quality-of-life wiring. Palette (source of truth): - Adopt the upstream alchemists-orchid.ghostty Nord-based, WCAG-AAA, astigmatism-friendly palette as the canonical SoT across every surface. - Add an explicit ANSI-16 + cursor/selection token layer to the .tokens.json sources (no resolver/compiler logic change — the whitelist already accepts arbitrary COLOR_* and the compiler auto-emits every .color entry). Recompile all .theme files; retune the semantic tokens + nvim component shades to the same hue family; regenerate docs/color-palette.md. Adapters: - shell/zellij/terminal adapters now read the explicit COLOR_ANSI_* tokens (byte-faithful per variant) plus cursor/selection; shell adds OSC 12 (cursor). - Ghostty output split: ghostty-colors (palette + cursor/selection, per theme) and a managed ghostty.conf (config-file include + QoL: cursor-style, unfocused-split-opacity, shell-integration, macos-option-as-alt, Zellij tab keybinds). - New theme_gen_adapter_termux writes ~/.termux/colors.properties and applies it live via termux-reload-settings; self-gates to a no-op off-Termux. Added to the generator targets. Wiring (configure-only, never installs an emulator): - New `potions terminal` command (.potions/lib/terminal/manager.sh): setup [ghostty|termux|all|--auto] backs up and idempotently wires the Ghostty config-file include and the Termux extra-keys row; status reports detection. - install.sh/upgrade.sh run `terminal setup --auto` after theme regen. - bin/potions routes `terminal`; help.sh/fallback help list theme + terminal. Docs/tests/release: - TERMINAL_SETUP.md gains first-class Ghostty + Termux sections; README note. - test.sh: ANSI-16 faithfulness, Ghostty cursor/selection + managed config, Termux colors.properties (on/off gate), terminal setup idempotency + backup. - Allowlist .potions/lib/terminal in .gitignore; bump .version 2.13.1 -> 2.14.0 and regenerate .checksums (install.sh, upgrade.sh, bin/potions changed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Ghostty wiring test created a fixture under $HOME/.config/ghostty but did not control XDG_CONFIG_HOME. On runners that preset XDG_CONFIG_HOME (Ubuntu CI), the manager correctly resolved the Ghostty config to $XDG_CONFIG_HOME instead of the fixture, so wiring did not touch the asserted file and the test failed (passed on macOS/Fedora/Termux where XDG_CONFIG_HOME is unset). The manager is correct — honoring XDG_CONFIG_HOME is the right behavior; the test was not hermetic. Pin XDG_CONFIG_HOME to the fixture in every manager invocation, and fix the `grep -c || echo 0` double-count (use `grep -Fc ... || true`). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Makes terminal emulators first-class in Potions — Ghostty (Linux/macOS) and Termux (Android) — with live theme rotation and quality-of-life wiring, and adopts the upstream
alchemists-orchid.ghosttypalette as the canonical theme.Built on three product decisions:
config-fileinclude.Palette — single source of truth
The upstream palette becomes the SoT for shell / NeoVim / Zellij / terminals. The theme system's design made this clean: the resolver whitelist already accepts any
COLOR_*token and the compiler auto-emits every.colorentry, so adding an explicit ANSI-16 + cursor/selection layer to the.tokens.jsonsources is pure data — no parser/compiler logic change. All three variants (dark#2e3440, white = upstream light#fafbfc, sepia#f5f0e6) are now byte-faithful to the upstream theme. Semantic tokens + nvim component shades retuned to the same hue family.Adapters
COLOR_ANSI_*tokens (byte-faithful per variant) + cursor/selection; shell adds OSC 12 (cursor).ghostty-colors(palette + cursor/selection, per theme) and a managedghostty.conf(config-file include + QoL:cursor-style,unfocused-split-opacity,shell-integration,macos-option-as-alt, Zellij tab keybinds).theme_gen_adapter_termuxwrites~/.termux/colors.propertiesand applies it live viatermux-reload-settings; self-gates to a no-op off-Termux. Added to the generator targets.potions terminalcommandNew
.potions/lib/terminal/manager.sh(mirrorstheme/manager.sh): configure-only, idempotent, backup-first wiring.terminal setup [ghostty|termux|all|--auto]— wires the Ghostty include and the Termuxextra-keysrow.terminal status— reports detection + wiring.install.sh/upgrade.shrunterminal setup --autoafter theme regen;bin/potionsroutesterminal; both help paths listtheme+terminal.Docs
TERMINAL_SETUP.mdgains first-class Ghostty + Termux sections; README note.docs/color-palette.mdregenerated.Test plan
./test.sh— 249/249 pass (new: ANSI-16 faithfulness, Ghostty cursor/selection + managed config, Termuxcolors.propertieson/off gate, terminal-setup idempotency + backup).scripts/compile-themes.sh --checkclean;--docsin sync.bin/potions:theme cyclerepaints all surfaces;terminal setup ghosttybacks up + wires once (idempotent); all three variants byte-faithful..version2.13.1 → 2.14.0;.checksumsregenerated, sorted, no drift (install.sh, upgrade.sh, bin/potions changed)..gitignoreallowlists.potions/lib/terminal/(default-deny tree — would not ship otherwise).🤖 Generated with Claude Code