Add ghostty_config_set_color_scheme C API
Companion to cmux #2710 — terminal surfaces losing theme after config reload.
Summary
Adds a new C API, ghostty_config_set_color_scheme, that lets embedders set the config's conditional theme state before finalization so conditional theme resolution (e.g. theme = light:Foo,dark:Bar) uses the correct scheme during ghostty_config_finalize.
Why
Without this, finalization always uses the ConditionalState default (.light), causing embedded apps (cmux) to load the wrong theme colors until a surface color-scheme change triggers re-derivation. The cmux PR that depends on this API is #2710; merging this first lets the cmux side repoint its ghostty submodule back to manaflow-ai/ghostty#main instead of rod's fork.
Test plan
-
zig buildclean - Call
ghostty_config_set_color_schemefrom embedder beforeghostty_config_finalize, confirm conditionaltheme = light:X,dark:Yresolves to the expected scheme - cmux PR #2710 green once pointer bumps to this merged SHA
Summary by cubic
Add ghostty_config_set_color_scheme C API to set the config’s color scheme before finalization so conditional themes resolve to the correct light/dark variant. Prevents wrong theme after config reload in embedders like cmux.
- New Features
- New API:
ghostty_config_set_color_scheme(ghostty_config_t, ghostty_color_scheme_e); call beforeghostty_config_finalizeto set.lightor.darkfor conditional theme resolution. Invalid values are ignored with a warning; default remains.lightif not set.
- New API:
Summary by CodeRabbit
- New Features
- Added a new public API function to set color scheme preferences (light or dark) on configuration objects with input validation.