Skip to content

feat(web): terminal ANSI colors in themes and a terminal cursor setting - #178

Merged
adampeterhiggins merged 1 commit into
mainfrom
ah/theme-terminal-to-match-cursor
Oct 6, 2026
Merged

adampeterhiggins merged 1 commit into
mainfrom
ah/theme-terminal-to-match-cursor

Conversation

@adampeterhiggins

Copy link
Copy Markdown
Owner

The terminal could only take its background, foreground, cursor and selection colors from a theme. The 16 ANSI colors were always Ghostty's built-in palette, and the cursor was always a block, so the terminal couldn't match an editor setup such as a Cursor/VS Code theme with an underline cursor.

ANSI colors in themes

  • 16 new theme roles (terminalAnsiBlack … terminalAnsiBrightWhite). Built-in and generated themes keep Ghostty's stock palette, so nothing changes visually until a theme sets them. A test checks the defaults against the palette the wasm reports.
  • The Ghostty core sends them through GHOSTTY_TERMINAL_OPT_COLOR_PALETTE. The theme's 16 colors replace the head of the default palette, leaving the 256-color cube unchanged. Without a theme, the core resets to Ghostty's palette. Colors a program sets with OSC 4 still win.
  • VS Code import reads terminal.ansi*, flattens alpha over the terminal background, and fills unset colors with VS Code's own defaults, so an imported theme looks the way it did in VS Code. Open VSX downloads keep these keys.
  • The theme editor's advanced view lists them under Terminal colors. The element inspector skips them because they only paint the canvas.
  • Theme reads reuse one probe canvas instead of creating one per color.

Terminal cursor setting

  • Settings → Appearance → Terminal cursor: block (default), bar, or underline. It is applied as Ghostty's default cursor style (GHOSTTY_TERMINAL_OPT_DEFAULT_CURSOR_STYLE), so programs that set their own cursor through DECSCUSR still win, and the style survives terminal resets.

This is web and desktop only. Mobile keeps its own terminal palette and preferences. Docs updated: docs/user/appearance.md, docs/fork-differences.md.

Screenshots still to add: I didn't launch a browser for this PR.

🤖 Generated with Claude Code (Claude Opus 5.5)

Themes now carry the terminal's 16 ANSI colors. Built-in and generated
themes keep Ghostty's stock palette, VS Code imports read terminal.ansi*
(falling back to VS Code's defaults), and the theme editor's advanced view
lists them under Terminal colors. Appearance settings gain a Terminal
cursor choice (block, bar, underline) applied as Ghostty's default cursor
style, so programs that set their own cursor still win.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

1 participant