Skip to content

⚡ Add AppKit terminal sessions with an isolated Ghostty XPC worker - #229

Merged
arach merged 6 commits into
mainfrom
codex/terminal-ipc-core
Sep 16, 2026
Merged

arach merged 6 commits into
mainfrom
codex/terminal-ipc-core

Conversation

@arach

@arach arach commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Host IPC Swift typecheck and Release helper compile pass on arm64/macOS 26.5 SDK.
  • Scout Release build passes against this commit.
  • Normal installed Scout grid passed fresh tmux input, resize, and navigation retention; footer passed input and resize separately.
  • Earlier probe passed frame ownership, hidden-pane demand, shutdown, and presentation during blocked app main thread.

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.

@arach arach changed the title 🧪 Prove Hudson terminal IPC with AppKit and Metal 🧪 Run real Ghostty terminal over XPC with AppKit and Metal Sep 16, 2026
@arach arach changed the title 🧪 Run real Ghostty terminal over XPC with AppKit and Metal ⚡ Add AppKit terminal sessions with an isolated Ghostty XPC worker Sep 16, 2026
@arach
arach marked this pull request as ready for review September 16, 2026 21:00
@arach
arach merged commit 4a60eb2 into main Sep 16, 2026
1 of 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