Update ghostty fork to latest upstream - #2379
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughReplaced the local Ghostty C header with an upstream include, advanced the Ghostty submodule and artifact checksum, adjusted Swift clipboard callback handling and hosted-view geometry refresh/coalescing (including split-divider interaction tracking), and rewrote ghostty-fork.md to reflect a March 30 rebase and reorganized fork notes. Changes
Sequence Diagram(s)sequenceDiagram
participant HostView as WindowTerminalHostView
participant Registry as TerminalWindowPortalRegistry
participant Scheduler as GeometrySyncScheduler
participant Reconciler as Reconciler
participant Surface as HostedSurface
HostView->>HostView: hitTest(point) detects split-divider (mouseDown)
HostView->>Registry: noteSplitDividerInteraction(windowId, eventType)
Registry->>Scheduler: scheduleExternalGeometrySynchronize(forceImmediate? true/false)
Scheduler->>Scheduler: coalesceRequests(accumulate forceImmediate)
Scheduler->>Reconciler: run sync (reason)
Reconciler->>Surface: reconcileVisibleHostedViewsAfterGeometrySync(reason)
Surface->>Surface: refreshSurfaceNow(reason)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR advances the Key changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Submodule as ghostty submodule
participant Checksums as ghosttykit-checksums.txt
participant Script as download-prebuilt-ghosttykit.sh
participant Release as manaflow-ai/ghostty releases
Dev->>Submodule: advance pointer bc9be90a → 0b231db94
Dev->>Checksums: add pinned SHA-256 for 0b231db94
Dev->>Release: publish xcframework-0b231db94 asset
Note over Script: CI / setup.sh invokes script
Script->>Submodule: git rev-parse HEAD → 0b231db94
Script->>Checksums: lookup expected SHA-256 for 0b231db94
Checksums-->>Script: dfbea73081fd7cd3b63d2c9c92252a0761aca7ef9d59f0642dca0c0abee84461
Script->>Release: curl GhosttyKit.xcframework.tar.gz
Script->>Script: shasum -a 256 → verify checksum
Script->>Script: extract GhosttyKit.xcframework
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Sources/TerminalWindowPortal.swift (1)
1155-1165: Avoid unconditional second-pass reconcile across all visible terminals.At Line 1161, every geometry sync now re-runs
reconcileGeometryNow()for all visible hosted views, even thoughsynchronizeHostedView(withId:)already does reconcile/refresh on geometry deltas. This can add noticeable resize overhead with many visible terminals.♻️ Suggested guard to limit expensive second-pass work
private func reconcileVisibleHostedViewsAfterGeometrySync(reason: String) { + // Keep this extra pass only for active geometry churn paths. + let duringGeometryChurn = + hostView.inLiveResize || + window?.inLiveResize == true || + TerminalWindowPortalRegistry.isInteractiveGeometryResizeActive + guard duringGeometryChurn else { return } + // During live resize, AppKit can deliver frame churn where outer portal geometry // settles a tick before the terminal's own scroll/surface hierarchy. Only force an // in-place surface refresh when reconciliation actually changed terminal geometry. for entry in entriesByHostedId.values { - guard let hostedView = entry.hostedView, !hostedView.isHidden else { continue } + guard entry.visibleInUI, + let hostedView = entry.hostedView, + !hostedView.isHidden else { continue } if hostedView.reconcileGeometryNow() { hostedView.refreshSurfaceNow(reason: reason) } } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Sources/TerminalWindowPortal.swift` around lines 1155 - 1165, reconcileVisibleHostedViewsAfterGeometrySync currently calls hostedView.reconcileGeometryNow() for every visible entry, causing unnecessary work; add a guard to skip the second-pass for entries that were already reconciled by synchronizeHostedView(withId:). To implement: add a lightweight flag/property on the entry (e.g., Entry.needsSecondPass or Entry.geometryDirtyToken) that synchronizeHostedView(withId:) sets/clears when it performs a reconcile/refresh, then in reconcileVisibleHostedViewsAfterGeometrySync iterate entriesByHostedId but only call hostedView.reconcileGeometryNow()/refreshSurfaceNow(reason:) when that flag indicates a missed reconcile; clear the flag after running to avoid repeated work.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@Sources/TerminalWindowPortal.swift`:
- Around line 1155-1165: reconcileVisibleHostedViewsAfterGeometrySync currently
calls hostedView.reconcileGeometryNow() for every visible entry, causing
unnecessary work; add a guard to skip the second-pass for entries that were
already reconciled by synchronizeHostedView(withId:). To implement: add a
lightweight flag/property on the entry (e.g., Entry.needsSecondPass or
Entry.geometryDirtyToken) that synchronizeHostedView(withId:) sets/clears when
it performs a reconcile/refresh, then in
reconcileVisibleHostedViewsAfterGeometrySync iterate entriesByHostedId but only
call hostedView.reconcileGeometryNow()/refreshSurfaceNow(reason:) when that flag
indicates a missed reconcile; clear the flag after running to avoid repeated
work.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0b0048e5-aee3-46c8-a25f-5f694b18805f
📒 Files selected for processing (2)
Sources/TerminalWindowPortal.swiftcmux-Bridging-Header.h
✅ Files skipped from review due to trivial changes (1)
- cmux-Bridging-Header.h
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="Sources/TerminalWindowPortal.swift">
<violation number="1" location="Sources/TerminalWindowPortal.swift:1749">
P3: This `if let activeSplitDividerDragWindowId` branch is unreachable because the same state is fully handled just above (return or clear), so the later check can never be true.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b78c00a9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…grade # Conflicts: # docs/ghostty-fork.md # ghostty # scripts/ghosttykit-checksums.txt
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 401ffb169e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
bc9be90a2to0b231db94, rebased on upstreammainat3509ccf78docs/ghostty-fork.mdand add the pinned GhosttyKit checksum for the new ghostty SHATesting
DEVELOPER_DIR=/Applications/Xcode_26.3.app/Contents/Developer ./scripts/reload.sh --tag issue-1199-ghostty-upgradeIssues
Summary by cubic
Updates the
ghosttysubmodule to the latest upstream and switches the Swift bridge to@import GhosttyKitwith a thin C shim that includesghostty/include/ghostty.h. Restores smooth live resize by only treating divider-origin drags as interactive, tracking them per mouse-down across windows, forcing immediate geometry syncs, and refreshing visible terminal surfaces; also picks up the macOS focus-transfer mouse fix (closes #1199).Dependencies
ghosttysubmodule to latest upstream.GhosttyKitin the bridging header; keep a thin wrapper that delegates to upstream’s canonical header.GhosttyKitchecksums.Bug Fixes
Written for commit 08fd53e. Summary will update on new commits.
Summary by CodeRabbit
Documentation
New Features
Bug Fixes
Chores