Repository navigation
Forward right/middle mouse drags to Ghostty (fixes tmux right-click menu) - #7319
Merged
Merged
Conversation
cmux overrode mouseDragged (left button) but not rightMouseDragged or otherMouseDragged, so pointer motion during a right- or middle-button drag was never forwarded to libghostty. Under an app that enables mouse reporting (e.g. tmux), this broke the right-click context menu: right-press opened it, but dragging to a menu item produced no hover highlight and release selected nothing. Add both overrides, funneling to mouseDragged the same way upstream Ghostty funnels every drag variant to one position-forwarding path.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change adds ChangesMouse Drag Event Forwarding
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ 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 |
Contributor
# Conflicts: # .github/swift-file-length-budget.tsv
azooz2003-bit
added a commit
that referenced
this pull request
Jul 4, 2026
…ng, themes) Delta: #7318/#7319 mouse cursor-shape + right/middle drag forwarding, #7320 ghostty upstream, #6664 iOS themes, #7196 iOS scroll, #7257/#7307 web, #7329 CLI suggestions, #7222 codex resume update-suppression. Conflicts resolved keeping HEAD structure: - GhosttyTerminalView.swift: took main's viewDidEndLiveResize + resetCursorRects (cursor-shape #7318; ghosttyMouseShape/ghosttyMouseCursor already in HEAD). - Mobile/MobileHostService.swift: union (kept HEAD sharedRequestActivity + main publicStatusPayload theme payload #6664). - project.pbxproj: union-dedup, normalized; test-wiring green. - swift-file-length-budget.tsv regenerated. #7222 (codex update-check suppression) partially landed: the CMUXAgentLaunch package part (AgentResumeArgv.codexUpdateCheckSuppressionOverride) auto-merged and is present; the app-target files (+CodexUpdateCheck.swift + test) extend SurfaceResumeCommandCanonicalizer, a type HEAD dissolved into the CmuxWorkspaces package, so they can't compile and the suppression was never wired (call site was in the HEAD-deleted +PortableAgentExecutable). Removed those two files; re-wire recorded in merge-deferred-gaps. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 7, 2026
This branch was successfully deployed
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.
What
In real Ghostty, right-click + drag + release drives tmux's right-click context
menu (open on press, highlight on drag, select on release). In cmux the menu
opened but dragging produced no hover highlight and release selected nothing.
How
cmux overrode
mouseDragged(left button) but notrightMouseDraggedorotherMouseDragged, so pointer motion during a right- or middle-button drag wasnever forwarded to libghostty via
ghostty_surface_mouse_pos. Under an app withmouse reporting on (tmux), the app never saw the drag. Add both overrides,
funneling to
mouseDraggedthe same way upstream Ghostty funnels every dragvariant to one position-forwarding path (
rightMouseDragged/otherMouseDragged->
mouseMoved). Middle-button drags are gated onbuttonNumber == 2to matchthe existing
otherMouseDown/otherMouseUp.Test
In cmux,
tmuxwithset -g mouse on, then right-click a pane: the tmuxcontext menu opens, dragging highlights items (hover), releasing selects the
highlighted item. Previously no highlight/selection.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Low Risk
Small, localized input-event forwarding in the terminal view with no auth, data, or API surface changes.
Overview
GhosttyTerminalViewnow forwards right-button and middle-button drag motion to libghostty the same way left-button drags already did, by addingrightMouseDraggedandotherMouseDraggedoverrides that call into the existingmouseDragged/ghostty_surface_mouse_pospath.That closes a gap where mouse-reporting programs (notably tmux with mouse on) saw press/release but not pointer motion during a right-click menu drag, so hover highlight and release-to-select did not work. Middle-button drags are limited to
buttonNumber == 2, consistent with the existingotherMouseDown/otherMouseUphandling.The Swift file length budget for
Sources/GhosttyTerminalView.swiftis bumped slightly for the new lines.Reviewed by Cursor Bugbot for commit 6785a84. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Forward right- and middle-button drag events to Ghostty so mouse-reporting apps (e.g., tmux) receive pointer motion during drags. Fixes tmux right-click menu hover/select and updates the Swift file-length budget for
Sources/GhosttyTerminalView.swift.rightMouseDraggedto delegate tomouseDragged.otherMouseDraggedfor middle button only (buttonNumber == 2), delegating tomouseDragged.Written for commit 63e0b17. Summary will update on new commits.
Summary by CodeRabbit