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 <noreply@anthropic.com>
This commit is contained in:
sminamot 2026-03-05 17:24:40 +09:00 committed by GitHub
parent 2712cabac9
commit bf28f5df4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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