diff --git a/Sources/GhosttyTerminalView.swift b/Sources/GhosttyTerminalView.swift index ded6ac00679f..504303ebc72f 100644 --- a/Sources/GhosttyTerminalView.swift +++ b/Sources/GhosttyTerminalView.swift @@ -4886,8 +4886,21 @@ class GhosttyNSView: NSView, NSUserInterfaceValidations { } } + // First pass: check if a menu item would handle this event. + // If not, process the key directly instead of relying on AppKit redispatch, + // which silently drops unbound Cmd+Shift combinations. + // Only route to main menu if shouldRouteCommandEquivalentDirectlyToMainMenu + // permits it (e.g., Cmd+` is intentionally excluded). + if !shouldRouteCommandEquivalentDirectlyToMainMenu(event) { + lastPerformKeyEvent = nil + return false + } lastPerformKeyEvent = event.timestamp - return false + if let menu = NSApp.mainMenu, menu.performKeyEquivalent(with: event) { + return true + } + equivalent = event.characters ?? "" + break } let finalEvent = NSEvent.keyEvent(