[PR #7182] feat(tui): add appearance setting with dark/light/system modes #12292

Open
opened 2026-02-16 18:17:12 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7182

State: open
Merged: No


Summary

Adds an appearance config option to control the TUI color scheme with three modes:

  • dark: Always use dark variant of theme
  • light: Always use light variant of theme
  • system: Auto-detect from terminal background color (polls every 5s)

Changes

  • Added appearance field to config schema (dark | light | system)
  • Added appearance selector UI in theme dialog with ←/→ keyboard navigation
  • Implemented theme mode detection (analyzes theme JSON to determine dark-only/light-only/both support)
  • Auto-disables unsupported modes for single-mode themes (e.g., aura, catppuccin-macchiato are dark-only)
  • Real-time terminal background detection using renderer.getPalette() for cross-platform support
  • Regenerated SDK types to include appearance field

Usage

Via Config

{
  "appearance": "system"
}

Via TUI

  1. Press Ctrl+X T to open theme dialog
  2. Use ←/→ to switch between System/Light/Dark modes
  3. Use ↑/↓ to browse themes

Screenshots

Screenshot 2026-01-07 at 16 23 32@2x

The appearance selector appears at the top of the theme dialog. Unsupported modes are dimmed and cannot be selected.

Testing

  • Tested with dark-only themes (aura, ayu, catppuccin-macchiato, nightowl)
  • Tested with dual-mode themes (flexoki, github, opencode, tokyonight)
  • Verified real-time system mode polling works across terminal theme changes
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7182 **State:** open **Merged:** No --- ## Summary Adds an `appearance` config option to control the TUI color scheme with three modes: - **dark**: Always use dark variant of theme - **light**: Always use light variant of theme - **system**: Auto-detect from terminal background color (polls every 5s) ## Changes - Added `appearance` field to config schema (`dark` | `light` | `system`) - Added appearance selector UI in theme dialog with ←/→ keyboard navigation - Implemented theme mode detection (analyzes theme JSON to determine dark-only/light-only/both support) - Auto-disables unsupported modes for single-mode themes (e.g., aura, catppuccin-macchiato are dark-only) - Real-time terminal background detection using `renderer.getPalette()` for cross-platform support - Regenerated SDK types to include `appearance` field ## Usage ### Via Config ```json { "appearance": "system" } ``` ### Via TUI 1. Press `Ctrl+X T` to open theme dialog 2. Use `←/→` to switch between System/Light/Dark modes 3. Use `↑/↓` to browse themes ## Screenshots <img width="3240" height="1882" alt="Screenshot 2026-01-07 at 16 23 32@2x" src="https://github.com/user-attachments/assets/fc3d1e76-4088-4460-8c09-6e96e959ea14" /> The appearance selector appears at the top of the theme dialog. Unsupported modes are dimmed and cannot be selected. ## Testing - Tested with dark-only themes (aura, ayu, catppuccin-macchiato, nightowl) - Tested with dual-mode themes (flexoki, github, opencode, tokyonight) - Verified real-time system mode polling works across terminal theme changes
yindo added the pull-request label 2026-02-16 18:17:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12292