Fix Cmd+Shift+key combos being swallowed for unbound keys (#1959)

Use charactersIgnoringModifiers instead of characters when redispatching
Cmd-modified key events in performKeyEquivalent. Cmd-modified keys don't
produce text characters, so event.characters returns an empty string for
Cmd+Shift combos, preventing Ghostty from encoding them as kitty protocol
sequences. charactersIgnoringModifiers returns the actual key character
(e.g. "k" for Cmd+Shift+K) while modifiers are preserved in modifierFlags.

Fixes #1718

Co-authored-by: CHE-3 <schumannzheng@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matthew Z. 2026-03-22 19:52:42 -04:00 committed by GitHub
parent e0e0e35279
commit eb248a1cdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5110,7 +5110,7 @@ class GhosttyNSView: NSView, NSUserInterfaceValidations {
if let lastPerformKeyEvent {
self.lastPerformKeyEvent = nil
if lastPerformKeyEvent == event.timestamp {
equivalent = event.characters ?? ""
equivalent = event.charactersIgnoringModifiers ?? ""
break
}
}