migrate the Mac terminal integration to SwiftTerm 2.0 - #100
Merged
Conversation
Use copied terminal snapshots, typed mouse responses and ordered raw-output consumers. Preserve per-screen Kitty restore, renderer policy and replay-safe control behavior, and pin the reviewed remote SwiftTerm integration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pin the reviewed diagnostic-only SwiftTerm fork, remove mitigation-specific callbacks and capacity retries, and document bounded content-free renderer logging. Retain initialization failure fallback, forced CoreGraphics, the warm renderer LRU, and the copied-state and raw-output integration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The broad terminal ownership and rendering migration depends on a still-unmerged cross-repository integration and warrants final human validation.
Pull request overview
Migrates the macOS terminal integration to SwiftTerm 2.0 while preserving remote capture, restoration ordering, renderer behavior, and wire compatibility.
Changes:
- Replaces mutable terminal access with copied snapshots and explicit input/output APIs.
- Updates renderer lifecycle, Kitty restoration, caching, and remote screen capture.
- Pins the integration fork and adds comprehensive migration tests and diagnostics documentation.
File summaries
| File | Description |
|---|---|
Tests/SwiftTermEmbeddingTests.swift |
Adds end-to-end SwiftTerm 2 integration coverage. |
Tests/AppLogicTests.swift |
Adapts existing tests to the new APIs. |
Sources/copilot-projects/TerminalsContainerView.swift |
Updates redraw documentation. |
Sources/copilot-projects/TerminalController.swift |
Uses actor isolation and copied terminal state. |
Sources/copilot-projects/RemoteModels+Capture.swift |
Projects snapshots onto the existing wire model. |
Sources/copilot-projects/RemoteKittyGraphics.swift |
Scans copied cells for Kitty placements. |
Sources/copilot-projects/RemoteGateway.swift |
Strengthens revision and cache consistency. |
Sources/copilot-projects/ProjectsTerminalView.swift |
Implements ordered output consumption and new renderer/input APIs. |
Sources/copilot-projects/AppModel.swift |
Captures remote screens from immutable snapshots. |
README.md |
Documents renderer behavior and diagnostics. |
Package.swift |
Pins the SwiftTerm 2 integration revision. |
Package.resolved |
Resolves the updated dependency graph. |
Review details
- Files reviewed: 11/12 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Mechanically merge the notification preview changes from main without conflict resolution. Preserve the reviewed diagnostic-only SwiftTerm pin and terminal integration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The terminal ownership and rendering migration affects process ordering, persistence, remote protocol behavior, and a large pinned dependency, warranting final human validation.
Review details
- Files reviewed: 11/12 changed files
- Comments generated: 0 new
- Review effort level: Balanced
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.
SwiftTerm 2 changes terminal ownership and bypasses our old raw-output override, so updating the dependency pin alone would break remote capture and restore ordering. Move the Mac integration to copied terminal values, explicit input operations, and an ordered pre-parse output consumer instead of reopening mutable terminal internals.
Preserve the remote wire contract, dtach lifetime, restore barrier, forced Core Graphics option, and three-renderer warm cache. The dependency retains the caret fix but replaces unconfirmed glyph/GPU mitigations with diagnostic-only logging; startup initialization fallback remains, without a new runtime recovery policy.
Coordination
Depends on the SwiftTerm 2 integration, pinned at
3e6a8632bbdeaf4c90921b0847ee240f76aa061f. Its embedding APIs remain submitted upstream. Land the integration fork with a normal merge so the immutable revision remains reachable. No mobile source or dependency update is required: the iOS app links only the unchanged shared protocol product.Diagnostics
The README documents the app-filtered unified-log query. Logging is bounded and content-free; a delayed completion warning is not proof of a GPU hang and requires subsequent redraw/teardown activity to be observed.
Validation
Covers real PTY capture, normal/alternate-screen image restoration, history/revision caching, input and replay-safe controls, actual forced-CG/warm-LRU behavior, and initialization/teardown failure reporting. Final dependency validation uses the published revision without a local override.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com