From 971d3659739bd0eeec642e211eb68e6087f76eaf Mon Sep 17 00:00:00 2001 From: Dustin Hilgaertner Date: Fri, 3 Apr 2026 15:55:18 -0500 Subject: [PATCH] Fix Mac Whisper speech-to-text producing beep instead of inserting text (#25) Add doCommand(by:) override to GhosttySurfaceView to prevent NSBeep when interpretKeyEvents dispatches unhandled selectors (noop:, cancel:, etc.). This also satisfies the NSTextInputClient protocol requirement, enabling external text injection tools like Mac Whisper to work properly. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Sources/CrowTerminal/GhosttySurfaceView.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Packages/CrowTerminal/Sources/CrowTerminal/GhosttySurfaceView.swift b/Packages/CrowTerminal/Sources/CrowTerminal/GhosttySurfaceView.swift index 57edc84..37d421b 100644 --- a/Packages/CrowTerminal/Sources/CrowTerminal/GhosttySurfaceView.swift +++ b/Packages/CrowTerminal/Sources/CrowTerminal/GhosttySurfaceView.swift @@ -194,6 +194,11 @@ public final class GhosttySurfaceView: NSView { return false } + public override func doCommand(by selector: Selector) { + // Prevents NSBeep for unhandled commands dispatched by interpretKeyEvents + // (e.g. noop:, cancel:). Also satisfies NSTextInputClient.doCommand(by:). + } + public override func keyDown(with event: NSEvent) { guard let surface else { return }