Skip to content

feat(ipc): GhosttyConfig serves the user's Ghostty config files - #311

Merged
afitzgerald merged 1 commit into
mainfrom
alan/ghostty-config-method
Sep 30, 2026
Merged

afitzgerald merged 1 commit into
mainfrom
alan/ghostty-config-method

Conversation

@afitzgerald

Copy link
Copy Markdown
Collaborator

Adds a read-only GhosttyConfig IPC method so the iPhone app can style its terminal panes with the user's own Ghostty config, the way the Mac app already does by reading the files locally.

  • Request {"method":"GhosttyConfig"}; response {"result":{"ghostty":{"text":"…","files":["/abs/path",…]}}}.
  • Load order matches ghostty's Config.loadDefaultFiles / the Mac app's AppState.ghosttyConfigPaths: $XDG_CONFIG_HOME/ghostty (replacing ~/.config/ghostty, not adding to it), then ~/Library/Application Support/com.mitchellh.ghostty; config before config.ghostty in each.
  • Unreadable/empty files skipped; no config is {"text":""}, never an error. config-file = includes and theme = are not resolved.
  • Purely additive: older cores answer unknown-method, which the client treats as "no config". Same listener and auth as every other method.
  • Documented in docs/wire-protocol.md.

Tests: TestGhosttyConfigOrder (legacy before current, XDG before Application Support, XDG_CONFIG_HOME replacing ~/.config, empty skipped — goes red with the name order swapped) and TestGhosttyConfigWireShape (raw bytes of the no-config answer). Unit and e2e suites green locally with -race -shuffle=on.

The iPhone app has no disk of its own to read ~/.config/ghostty from, so
the core serves the files instead: their paths in load order, and their
text concatenated in that order. The order matches ghostty's
loadDefaultFiles and the Mac app's AppState.ghosttyConfigPaths (XDG dir,
with XDG_CONFIG_HOME replacing ~/.config, then Application Support;
legacy `config` before `config.ghostty`), since later files override
earlier ones. Includes and themes are left to the client.

Purely additive: no config is an empty answer rather than an error, and
older cores answer unknown-method, which the client reads the same way.
@afitzgerald
afitzgerald merged commit 751db26 into main Sep 30, 2026
3 checks passed
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