feat(cli): make terminal theme detection skin-aware and readable in light mode#1187
Closed
peteromallet wants to merge 2 commits intoNousResearch:mainfrom
Closed
feat(cli): make terminal theme detection skin-aware and readable in light mode#1187peteromallet wants to merge 2 commits intoNousResearch:mainfrom
peteromallet wants to merge 2 commits intoNousResearch:mainfrom
Conversation
…ites Add light/dark theme support with automatic terminal background detection via OSC 11. Move save_config_value() to hermes_cli/config.py as the single source of truth, replacing the raw yaml hack in skin_engine. Add public get_theme_mode_setting() getter to avoid poking at private module state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove hardcoded colors from cli.py and banner.py in favor of skin-aware lookups. Convert banner ASCII art from module-level constants to dynamic functions that read skin colors at call time. Remove stale detected_background config caching that defeated auto-detection. Add COLORFGBG and macOS appearance fallbacks for terminal background detection. Darken colors_light values across all skins for proper contrast on light backgrounds. Make input-area and completion menu styles theme-aware. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b00735c to
d3ad2e1
Compare
teknium1
added a commit
that referenced
this pull request
Mar 17, 2026
Add display.theme_mode setting (auto/light/dark) that makes the CLI readable on light terminal backgrounds. - Auto-detect terminal background via COLORFGBG, OSC 11, and macOS appearance (fallback chain in hermes_cli/colors.py) - Add colors_light overrides to all 7 built-in skins with dark/readable colors for light backgrounds - SkinConfig.get_color() now returns light overrides when theme is light - get_prompt_toolkit_style_overrides() uses light bg colors for completion menus in light mode - init_skin_from_config() reads display.theme_mode from config - 7 new tests covering theme mode resolution, detection fallbacks, and light-mode skin overrides Salvaged from PR #1187 by @peteromallet. Core design preserved; adapted to current main (kept all existing helpers, tool_emojis, convenience functions that were added after the PR branched). Co-authored-by: Peter O'Mallet <peteromallet@users.noreply.github.com>
Contributor
|
Salvaged onto current main — the core design is preserved, adapted to the current codebase (600 commits of drift). Your commit is co-authored. What landed:
Adapted for current main: kept all convenience helpers ( |
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.
What does this PR do?
When I opened Hermes for the first time in a light terminal, a bunch of the CLI was still too light to read cleanly — not just the prompt/input area, but also banner/system text and other UI surfaces.
This makes the CLI theme handling more cohesive end-to-end:
Related Issue
Fixes #
Type of Change
Changes Made
display.theme_modewithauto | light | darkCOLORFGBGand macOS appearance fallbacks when neededcolors_lightvalues across built-in skins so light-mode contrast stays readable without losing the Hermes lookcli-config.yaml.exampleto document the new display setting and light-mode overridesHow to Test
/skin theme auto,/skin theme light, and/skin theme darkand confirm the selected mode is reflected correctly.display.theme_modein config.Screenshots / Logs
Before / after on Desktop:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/ATargeted tests related to this change passed:
python3 -m pytest tests/hermes_cli/test_skin_engine.py tests/hermes_cli/test_config.py tests/hermes_cli/test_setup.py tests/hermes_cli/test_set_config_value.py tests/test_cli_init.py tests/test_cli_loading_indicator.py tests/test_cli_model_command.py tests/test_cli_secret_capture.py -q103 passedI also ran the full suite with
python3 -m pytest tests/ -q.It still does not go fully green in this local environment because 3 existing failures remain outside this change set:
tests/test_cli_provider_resolution.py::test_codex_provider_uses_config_modeltests/test_quick_commands.py::TestCLIQuickCommands::test_exec_command_runs_and_prints_outputtests/test_quick_commands.py::TestCLIQuickCommands::test_quick_command_takes_priority_over_skill_commandsI verified those same 3 failures reproduce on a clean
origin/mainworktree as well, and this branch does not touch the failing code paths, so they appear to be pre-existing and unrelated to this PR.Let me know if you have any issues with the approach or want me to tighten up any of the theme defaults.