From d1d9b49a0953bbe4e8b8a33eb1a8a18437723afc Mon Sep 17 00:00:00 2001 From: lawrencecchen <54008264+lawrencecchen@users.noreply.github.com> Date: Sat, 4 Jul 2026 00:07:15 -0700 Subject: [PATCH 1/2] Forward right/middle mouse drags to Ghostty for mouse-reporting apps 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. --- Sources/GhosttyTerminalView.swift | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Sources/GhosttyTerminalView.swift b/Sources/GhosttyTerminalView.swift index 79cfab793b16..e13ed8886a98 100644 --- a/Sources/GhosttyTerminalView.swift +++ b/Sources/GhosttyTerminalView.swift @@ -7357,6 +7357,26 @@ class GhosttyNSView: NSView, NSUserInterfaceValidations { ghostty_surface_mouse_pos(surface, eventPoint.x, bounds.height - eventPoint.y, mouseModsFromEvent(event)) } + override func rightMouseDragged(with event: NSEvent) { + // Forward right-button drags so mouse-reporting apps receive pointer + // motion while the right button is held. Without this, tmux's + // right-click context menu (press to open, drag to highlight, release + // to select) never sees the drag and cannot track hover state. Mirrors + // mouseDragged and matches upstream Ghostty, which funnels every drag + // variant to the same position-forwarding path. + mouseDragged(with: event) + } + + override func otherMouseDragged(with event: NSEvent) { + // Only the middle button (buttonNumber 2) is forwarded to Ghostty, to + // stay consistent with otherMouseDown/otherMouseUp above. + guard event.buttonNumber == 2 else { + super.otherMouseDragged(with: event) + return + } + mouseDragged(with: event) + } + #if DEBUG func debugHasPendingLeftMouseReleaseForTesting() -> Bool { hasPendingLeftMouseRelease From 6785a84aaba5d8a5f3cc326fb864952319dc4957 Mon Sep 17 00:00:00 2001 From: lawrencecchen <54008264+lawrencecchen@users.noreply.github.com> Date: Sat, 4 Jul 2026 00:34:34 -0700 Subject: [PATCH 2/2] Refresh Swift file-length budget for GhosttyTerminalView.swift growth --- .github/swift-file-length-budget.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/swift-file-length-budget.tsv b/.github/swift-file-length-budget.tsv index 3b81deaa264c..2389c5ae227e 100644 --- a/.github/swift-file-length-budget.tsv +++ b/.github/swift-file-length-budget.tsv @@ -7,7 +7,7 @@ 14270 Sources/TerminalController.swift 13172 Sources/Workspace.swift 12348 cmuxTests/AppDelegateShortcutRoutingTests.swift -12212 Sources/GhosttyTerminalView.swift +12232 Sources/GhosttyTerminalView.swift 11669 Sources/Panels/BrowserPanel.swift 9497 cmuxTests/CLINotifyProcessIntegrationRegressionTests.swift 8032 Sources/Panels/BrowserPanelView.swift