Skip to content

Sync ghostty with upstream (1,150 commits)#2374

Open
lawrencecchen wants to merge 6 commits into
mainfrom
ghostty-sync
Open

Sync ghostty with upstream (1,150 commits)#2374
lawrencecchen wants to merge 6 commits into
mainfrom
ghostty-sync

Conversation

@lawrencecchen
Copy link
Copy Markdown
Contributor

@lawrencecchen lawrencecchen commented Mar 30, 2026

Summary

Updates ghostty submodule to sync fork with upstream ghostty-org/ghostty, catching up 1,150 commits (Feb 17 to Mar 30).

Fixes #1199 (click-after-tab-switch triggers infinite select scroll) via upstream ghostty-org/ghostty#11167.

Ghostty fork PR: manaflow-ai/ghostty#22

Carried forward (13 cmux patches):

  • Display link restart, resize blank frames, stale-frame gravity
  • OSC 99 notification parser
  • Theme picker (7 commits)
  • Mode 2031 color scheme fixes (2 commits)

Dropped (in favor of upstream):

  • cursor-click-to-move for OSC133
  • Pure prompt redraw markers
  • No-reflow resize override revert

Test plan

  • Tab away from cmux, tab back, click a pane: no infinite scroll select
  • Theme picker works
  • Notifications work
  • Pure prompt renders correctly (dropped our patch, relying on upstream)

Summary by cubic

Syncs ghostty submodule with upstream (Feb 17–Mar 30) and rebases 13 cmux patches. Fixes the enum-shift crash from upstream tab title action by pinning its value and handling it in Swift (emits .ghosttyDidSetTitle), updates the OSC 99 parser, and resolves #1199 (infinite select scroll after tab switch).

  • Dependencies
    • Add four new GhosttyKit checksums for the upstream build.
    • Re-export ghostty_surface_clear_selection for cmux.
    • Carried forward: link restart; resize blank frames; stale-frame gravity; theme picker; mode 2031 color fixes.
    • Dropped: cursor-click-to-move (OSC133); pure prompt redraw markers; no-reflow resize override revert.

Written for commit f204e84. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Updated the ghostty submodule to track a newer upstream commit to align with an updated upstream version.
    • Added a new pinned checksum entry to record and verify a specific ghostty artifact.

Syncs manaflow-ai/ghostty fork with upstream ghostty-org/ghostty,
rebasing 13 cmux patches onto latest upstream.

Includes fix for click-after-tab-switch infinite scroll (issue 1199)
via upstream ghostty-org/ghostty#11167.
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Mar 31, 2026 0:41am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 30, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Updated the tracked ghostty git submodule commit reference and added a new pinned checksum entry; no exported or public entity declarations were modified.

Changes

Cohort / File(s) Summary
Ghostty submodule pointer
ghostty
Updated tracked ghostty submodule commit from bc9be90a21997a4e5f06bf15ae2ec0f937c2dc42 to ce2181d52d6208f0bad8761c31e25dd68b5bb10f (submodule pointer change only).
Checksum pin list
scripts/ghosttykit-checksums.txt
Added a new pinned checksum line: f2f7b140d0b5b351df3d813346d25b60f9532661 b1ae01a37932738c8e81d594a753f11002b5a8ef2158e13bfbb7ff8f159c54d9.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 A tiny hop, a SHA anew,
I nudged the pointer, stitched the view,
Checksum snug in tidy line,
No loud trumpet, just a sign,
Carrot dreams — code naps, hooray!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: syncing the ghostty submodule with upstream and specifies the magnitude of the update (1,150 commits).
Linked Issues check ✅ Passed The PR successfully addresses issue #1199 by including the upstream ghostty-org/ghostty#11167 fix for the click-after-tab-switch infinite select scroll bug.
Out of Scope Changes check ✅ Passed All changes are in-scope: submodule update to sync with upstream, checksum addition for GhosttyKit, and rebasing of 13 cmux-specific patches as intended.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is comprehensive and detailed, covering the summary, rationale, and test plan as required by the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ghostty-sync

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 30, 2026

Greptile Summary

This PR bumps the ghostty submodule pointer from bc9be90aee2595ca, merging 1,150 upstream commits (Feb 17 – Mar 30, 2026) into the cmux fork. It carries forward 13 cmux-specific patches (OSC 99 notifications, display-link restart, resize stale-frame mitigation, theme picker hooks, Mode 2031 colour scheme fixes) and drops three patches that have since landed upstream or are no longer needed (cursor-click-to-move, Pure prompt redraw markers, no-reflow resize override revert). The primary motivation is fixing the click-after-tab-switch infinite scroll-select bug (issue #1199) via upstream ghostty-org/ghostty#11167.

Key points:

  • Only file changed is the ghostty submodule SHA — no Swift/Zig source modifications in the parent repo.
  • docs/ghostty-fork.md is not updated to reflect the dropped patches (sections 5 & 6 for zsh prompt redraws), the newly carried "Mode 2031 colour scheme fixes", or the new sync date — CLAUDE.md explicitly requires keeping this file current with every fork change.

Confidence Score: 5/5

  • Safe to merge; the only remaining finding is stale documentation in docs/ghostty-fork.md, which doesn't affect runtime behaviour.
  • The PR is a single submodule pointer change with a clear test plan covering the primary regression, theme picker, notifications, and Pure prompt rendering. All findings are P2 (documentation staleness), so the score remains 5/5 per the confidence guidance.
  • docs/ghostty-fork.md — needs to reflect dropped patches and the new sync date, but this does not block merge.

Important Files Changed

Filename Overview
ghostty Submodule pointer bumped from bc9be90a to ee2595ca, syncing 1,150 upstream commits (Feb 17 – Mar 30); 13 cmux patches carried forward, 3 dropped in favour of upstream equivalents.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[ghostty upstream\nbc9be90a → ee2595ca\n1,150 commits] --> B{cmux fork rebase\nmanaflow-ai/ghostty}

    B --> C[Patches CARRIED FORWARD]
    B --> D[Patches DROPPED]

    C --> C1[OSC 99 kitty notification parser]
    C --> C2[macOS display-link restart]
    C --> C3[Resize stale-frame mitigation]
    C --> C4[Keyboard copy-mode C API]
    C --> C5[Theme picker helper hooks\n7 commits]
    C --> C6[Mode 2031 colour scheme fixes\n2 commits]

    D --> D1[cursor-click-to-move OSC 133\nalready upstream]
    D --> D2[Pure prompt redraw markers\nupstream handles it]
    D --> D3[No-reflow resize override revert]

    B --> E[Parent repo\nsubmodule pointer update\nghostty @ ee2595ca]
    E --> F[Fixes issue 1199\nclick-after-tab-switch\ninfinite scroll-select]
Loading

Comments Outside Diff (1)

  1. docs/ghostty-fork.md, line 13-103 (link)

    P2 ghostty-fork.md not updated for this sync

    CLAUDE.md requires keeping docs/ghostty-fork.md up to date with every fork change. This PR makes several changes that aren't reflected in the document:

    1. Date is stale — line 15 still reads "as of March 12, 2026"; this sync covers through March 30, 2026.
    2. Sections 5 & 6 (zsh prompt redraw markers) should be removed — the PR description explicitly states "Pure prompt redraw markers" were dropped in favour of upstream, but both sections still appear here.
    3. "Mode 2031 color scheme fixes (2 commits)" — described in the PR as carried forward, but there is no corresponding section in this file documenting the affected commits, files, and conflict-prone areas.
    4. "No-reflow resize override revert" — dropped per the PR, but never appears in this doc (neither in "Current fork changes" nor "Upstreamed fork changes").

Reviews (1): Last reviewed commit: "Update ghostty submodule to upstream syn..." | Re-trigger Greptile

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ghostty`:
- Line 1: The submodule bump to commit ee2595cae16fbdf9d91e9c371fa1f63c189c59a1
is failing CI because scripts/ghosttykit-checksums.txt lacks the checksum for
the new GhosttyKit artifact; compute the correct checksum for the GhosttyKit
artifact that corresponds to commit ee2595ca..., and add a new entry in
scripts/ghosttykit-checksums.txt using the same filename/format as the existing
entries (match spacing and delimiter rules), then commit that change alongside
the submodule bump so CI/macOS jobs can validate the checksum.
- Line 1: The submodule pointer for ghostty references commit
ee2595cae16fbdf9d91e9c371fa1f63c189c59a1 which hasn’t been pushed to the remote
origin/main; push that commit to the manaflow-ai/ghostty repository's main
branch so the submodule pointer resolves, then update docs/ghostty-fork.md to
document the fork/merge notes and any conflict resolution steps for this sync
(mention the commit hash ee2595cae16fbdf9d91e9c371fa1f63c189c59a1 and that the
submodule path ghostty now points to origin/main).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 10881050-6dc3-423a-9370-6e2894ee348e

📥 Commits

Reviewing files that changed from the base of the PR and between c2abfb9 and 6f2d416.

📒 Files selected for processing (1)
  • ghostty

Comment thread ghostty Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 370025545b

ℹ️ 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".

Comment thread Sources/GhosttyTerminalView.swift Outdated
}
}
return true
case ghostty_action_tag_e(rawValue: 33): // GHOSTTY_ACTION_SET_TAB_TITLE
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Match SET_TAB_TITLE to the correct action enum value

ghostty_action_tag_e(rawValue: 33) does not correspond to tab-title updates in the synced Ghostty API; in the checked-in enum ordering (ghostty.h), raw value 33 is GHOSTTY_ACTION_PRESENT_TERMINAL, while SET_TAB_TITLE is a distinct action after SET_TITLE. This means real tab-title actions will bypass this handler, and any action with tag 33 can be incorrectly consumed here (returning true), potentially suppressing its intended behavior.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83c21993d1

ℹ️ 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".

Comment thread Sources/GhosttyTerminalView.swift Outdated
Comment on lines +2595 to +2596
case ghostty_action_tag_e(rawValue: 33): // GHOSTTY_ACTION_SET_TAB_TITLE
let title = action.action.set_title.title
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid decoding action tag 33 as tab-title payload

This branch can mis-handle real actions because 33 is not SET_TAB_TITLE in the checked-in C API for this commit: fresh evidence is that ghostty.h maps value 33 to GHOSTTY_ACTION_PROMPT_TITLE (enum section) and its union slot is prompt_title, not set_title. When Ghostty emits tag 33, this code reads action.action.set_title.title from the wrong union member, which can produce invalid strings or crash depending on payload, and it also consumes the action (return true) so the intended prompt-title behavior is lost.

Useful? React with 👍 / 👎.

Upstream added GHOSTTY_ACTION_SET_TAB_TITLE at position 33, shifting
all subsequent enum values. Swift/Xcode couldn't import the new value,
causing every action after position 33 to be misinterpreted (e.g.
COMMAND_FINISHED matched as START_SEARCH, crashing on garbage pointer).

Fix: move SET_TAB_TITLE to the end of the C ABI enum so existing
values keep their positions. Handle it via raw value in Swift.
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.

Clicking into a pane directly after tabbing into cmux reliably starts an upward infinite select scroll

1 participant