Repository navigation
⚡ Add AppKit terminal sessions with an isolated Ghostty XPC worker - #229
Merged
Merged
Conversation
arach
marked this pull request as ready for review
September 16, 2026 21:00
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.
Summary
Add real Ghostty frame export over XPC and the production AppKit terminal session API consumed by Scout. One signed embedded worker owns multiple PTYs, parsers, scrollback buffers, and renderers. The host receives IOSurface leases and submits Metal presentation off the app main thread; terminal output never passes through SwiftUI.
The worker authenticates its host, bounds export memory, coalesces completed frames and resize generations, and releases leases only after GPU completion. Hidden panes retain PTY processing while pausing frame export. Input is ordered and acknowledged. Helper failure requires explicit restart rather than automatically rerunning commands.
The existing synthetic and real-engine isolation probes remain regression fixtures. Production code is in HudsonTerminal/IPC and Tools/TerminalWorker. Builder selects Xcode via xcrun and accepts an explicit validated SDK without raising deployment above macOS 26.0.
Validation
Depends on Termini frame export. Consumer Scout terminal integration pins this implementation. Independent runtime review is in progress. The consumer now pins patched-engine acquisition and retains release provenance; this source PR does not certify a public native release.
Known initial limits: live font/theme updates, full terminal-content accessibility, and precise IME candidate positioning. Correctness checks do not establish performance parity with standalone Ghostty.
Final regression checks cover queued startup input, ordered drain, last-owner teardown, and cancellation of a late open reply. The hub holds sessions weakly, signature inspection runs off the main thread, and resize/drawable recovery is bounded.