From bf28f5df4b1ab6a154bfda9a8d16a9de9faf6804 Mon Sep 17 00:00:00 2001 From: sminamot Date: Thu, 5 Mar 2026 17:24:40 +0900 Subject: [PATCH] Skip Ctrl fast path during IME composition (#790) During IME composition (e.g. Japanese input), Ctrl+H should delete composing characters via the IME, not bypass it and send a backspace directly to the terminal. Add a hasMarkedText() check so the fast path is only taken when no IME composition is active, letting interpretKeyEvents() handle the key instead. Co-authored-by: Claude Opus 4.6 --- Sources/GhosttyTerminalView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/GhosttyTerminalView.swift b/Sources/GhosttyTerminalView.swift index e461e9d1..7855f1fc 100644 --- a/Sources/GhosttyTerminalView.swift +++ b/Sources/GhosttyTerminalView.swift @@ -3992,7 +3992,7 @@ class GhosttyNSView: NSView, NSUserInterfaceValidations { // AppKit text interpretation and send a single deterministic Ghostty key event. // This avoids intermittent drops after rapid split close/reparent transitions. let flags = event.modifierFlags.intersection(.deviceIndependentFlagsMask) - if flags.contains(.control) && !flags.contains(.command) && !flags.contains(.option) { + if flags.contains(.control) && !flags.contains(.command) && !flags.contains(.option) && !hasMarkedText() { ghostty_surface_set_focus(surface, true) var keyEvent = ghostty_input_key_s() keyEvent.action = event.isARepeat ? GHOSTTY_ACTION_REPEAT : GHOSTTY_ACTION_PRESS