Skip to content

migrate the Mac terminal integration to SwiftTerm 2.0 - #100

Merged
sirfergy merged 3 commits into
mainfrom
sirfergy/swiftterm-v2
Sep 1, 2026
Merged

migrate the Mac terminal integration to SwiftTerm 2.0#100
sirfergy merged 3 commits into
mainfrom
sirfergy/swiftterm-v2

Conversation

@sirfergy

@sirfergy sirfergy commented Aug 31, 2026

Copy link
Copy Markdown
Owner

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

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@sirfergy
sirfergy marked this pull request as ready for review September 1, 2026 17:24
@sirfergy
sirfergy merged commit 08f217d into main Sep 1, 2026
2 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.

3 participants