feat(ipc): GhosttyConfig serves the user's Ghostty config files - #311
Merged
Merged
Conversation
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.
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.
Adds a read-only
GhosttyConfigIPC 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.{"method":"GhosttyConfig"}; response{"result":{"ghostty":{"text":"…","files":["/abs/path",…]}}}.Config.loadDefaultFiles/ the Mac app'sAppState.ghosttyConfigPaths:$XDG_CONFIG_HOME/ghostty(replacing~/.config/ghostty, not adding to it), then~/Library/Application Support/com.mitchellh.ghostty;configbeforeconfig.ghosttyin each.{"text":""}, never an error.config-file =includes andtheme =are not resolved.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) andTestGhosttyConfigWireShape(raw bytes of the no-config answer). Unit and e2e suites green locally with-race -shuffle=on.