Feature: let the TUI follow the terminal ANSI palette / support custom themes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Summary
Add support for jcode's TUI to optionally follow the terminal's 16-color ANSI palette (and/or a user-defined custom theme), instead of only the built-in auto/dark/light themes.
Motivation
The current theme config only accepts auto, dark, or light, and jcode renders its UI with fixed theme colors via crossterm. This means a user who has carefully themed their terminal (e.g. an iTerm2 dynamic profile with a Gruvbox / Tokyo Night / One Dark / Andromeda ANSI palette) sees their shell + prompt follow that palette, but jcode's own chrome stays on its built-in dark theme regardless.
By contrast, some other TUIs (e.g. Claude Code) map parts of their UI onto the terminal's ANSI palette slots, so switching terminal profiles recolors the tool to match. Users who switch profiles for day/night or eye-comfort reasons would like jcode to visually match the rest of their terminal.
Proposed options (any one would help)
theme = "ansi16"(or"terminal"): render UI accents using ANSI palette indices (0-15) so jcode inherits whatever the terminal profile defines, instead of hardcoded RGB.- Custom theme via config: a
[colors]/[theme.custom]table where users map jcode's semantic roles (accent, border, success, warning, error, muted, etc.) to hex values or ANSI indices. - Named built-in themes: ship a few popular palettes (Gruvbox, Tokyo Night, One Dark, Nord, Dracula, Solarized) selectable via
theme = "gruvbox"etc.
Option 1 is the lowest-effort win for "match my terminal." Option 2 is the most flexible. Option 3 is the most turnkey.
Additional context
- Confirmed against the current binary: valid
themevalues areauto/dark/light; there is no[colors]/color_scheme/ custom palette key. - jcode already has a
JCODE_GLYPH_SAFE_MODEthat quantizes to the 256-palette on some terminals, but that does not reliably map to the 16 profile-defined ANSI slots, so it is not a substitute for palette-following. - Environment: macOS, iTerm2, Homebrew install, jcode v0.61.0.
Thanks for considering. Happy to test a build if this lands behind a flag.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the theme configuration parsing and the crossterm color-rendering entry points. Clarify with maintainers whether ANSI16 support, custom themes, or named palettes is the intended scope before implementation. Done should include the selected configuration behavior and coverage for palette selection and rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100