From 4031815a8db163950b97de18026003c10b41eac7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 3 Jan 2025 14:39:22 -0800 Subject: [PATCH] macos: if a key event would result in an immediate binding then do it --- macos/Sources/Ghostty/SurfaceView_AppKit.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Ghostty/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/SurfaceView_AppKit.swift index 8e68161b1..634224c8e 100644 --- a/macos/Sources/Ghostty/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/SurfaceView_AppKit.swift @@ -810,7 +810,14 @@ extension Ghostty { return false } - // If this event as-is would result in a key event then + // If this event as-is would result in a key binding then we send it. + if let surface, + ghostty_surface_key_is_binding( + surface, + event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS)) { + self.keyDown(with: event) + return true + } // Only process keys when Control is active. All known issues we're // resolving happen only in this scenario. This probably isn't fully robust