From 29fead659cb4f3de2609c9214cc3f5efef123af5 Mon Sep 17 00:00:00 2001 From: Dustin Hilgaertner Date: Mon, 15 Jun 2026 09:49:24 -0500 Subject: [PATCH] =?UTF-8?q?Add=20Edit=20menu=20so=20=E2=8C=98V/dictation?= =?UTF-8?q?=20work=20in=20Settings=20text=20fields=20(#512)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Settings text fields couldn't accept a paste — ⌘V did nothing and dictation/voice insertion failed. The app built a custom NSApp.mainMenu with only an App menu, so the standard cut:/copy:/paste:/selectAll:/undo selectors were never registered on the responder chain and ⌘V in plain SwiftUI TextField/TextEditor was silently dropped. Add a standard Edit menu (Undo/Redo/Cut/Copy/Paste/Select All) wired to the first responder in setupMenu(). This is an app-wide fix. The terminal is unaffected: GhosttySurfaceView.performKeyEquivalent intercepts ⌘V/⌘C at the view level before the main menu sees them. 🐦‍⬛ Generated with Claude Code, orchestrated by Crow Co-Authored-By: Claude Crow-Session: 8CC01877-519E-428E-90B8-63D473C0D838 --- Sources/Crow/App/AppDelegate.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Sources/Crow/App/AppDelegate.swift b/Sources/Crow/App/AppDelegate.swift index 5cc4868..7395898 100644 --- a/Sources/Crow/App/AppDelegate.swift +++ b/Sources/Crow/App/AppDelegate.swift @@ -1080,6 +1080,23 @@ final class AppDelegate: NSObject, NSApplicationDelegate { appMenuItem.submenu = appMenu mainMenu.addItem(appMenuItem) + // Edit menu — registers the standard cut/copy/paste/select-all/undo + // selectors on the responder chain so ⌘V and dictation work in SwiftUI + // text fields (Settings). Routed to the first responder (target nil). + // The terminal is unaffected: GhosttySurfaceView.performKeyEquivalent + // intercepts ⌘V/⌘C at the view level before the main menu sees them. (#512) + let editMenuItem = NSMenuItem() + let editMenu = NSMenu(title: "Edit") + editMenu.addItem(withTitle: "Undo", action: Selector(("undo:")), keyEquivalent: "z") + editMenu.addItem(withTitle: "Redo", action: Selector(("redo:")), keyEquivalent: "Z") + editMenu.addItem(.separator()) + editMenu.addItem(withTitle: "Cut", action: #selector(NSText.cut(_:)), keyEquivalent: "x") + editMenu.addItem(withTitle: "Copy", action: #selector(NSText.copy(_:)), keyEquivalent: "c") + editMenu.addItem(withTitle: "Paste", action: #selector(NSText.paste(_:)), keyEquivalent: "v") + editMenu.addItem(withTitle: "Select All", action: #selector(NSText.selectAll(_:)), keyEquivalent: "a") + editMenuItem.submenu = editMenu + mainMenu.addItem(editMenuItem) + NSApp.mainMenu = mainMenu }