native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Gate ghostty performKeyEquivalent on actual first-responder (#264)

The cached `focused` flag is updated via `becomeFirstResponder` /
`resignFirstResponder`, but AppKit walks `performKeyEquivalent` over
every view in the window. Clicking a sidebar `List` row takes
selection without always demoting the surface out of the responder
chain, so ⌘⌫ reached `keyDown` and was consumed by the terminal
instead of firing Archive Worktree in the main menu. Check
`window?.firstResponder === self` alongside `focused` so the surface
only processes events AppKit actually routes to it.

authored by

Stefano Bertagno and committed by
GitHub
539c0feb 34da9417

+7 -1
+7 -1
supacode/Infrastructure/Ghostty/GhosttySurfaceView.swift
··· 1018 1018 override func performKeyEquivalent(with event: NSEvent) -> Bool { 1019 1019 guard event.type == .keyDown else { return false } 1020 1020 guard let surface else { return false } 1021 - guard focused else { return false } 1021 + // `focused` is a cached flag updated via `becomeFirstResponder` / 1022 + // `resignFirstResponder`, but AppKit calls `performKeyEquivalent` 1023 + // on every view in the window — including this one when the 1024 + // sidebar `List` has been clicked but didn't formally demote us 1025 + // out of the responder chain. Gate strictly on AppKit's current 1026 + // answer so a click on the sidebar lets ⌘⌫ reach the main menu. 1027 + guard focused, window?.firstResponder === self else { return false } 1022 1028 1023 1029 if let bindingFlags = bindingFlags(for: event, surface: surface) { 1024 1030 // Only forward to the main menu when the event actually matches one of our registered