From f7e7d6aa41925369058182535e488808e0bfd9d1 Mon Sep 17 00:00:00 2001 From: Helmut Januschka Date: Sat, 3 Jan 2026 23:36:59 +0100 Subject: [PATCH] fix(tui): add legacy terminal support for shift+letter shortcuts In legacy terminals, Shift+P produces uppercase 'P' instead of Kitty protocol sequences. Add fallback to check uppercase letters for shift+letter combinations. --- packages/tui/src/keys.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/tui/src/keys.ts b/packages/tui/src/keys.ts index 4ec1503f..22a36036 100644 --- a/packages/tui/src/keys.ts +++ b/packages/tui/src/keys.ts @@ -418,6 +418,12 @@ export function matchesKey(data: string, keyId: KeyId): boolean { return matchesKittySequence(data, codepoint, MODIFIERS.shift + MODIFIERS.ctrl); } + if (shift && !ctrl && !alt) { + // Legacy: shift+letter produces uppercase + if (data === key.toUpperCase()) return true; + return matchesKittySequence(data, codepoint, MODIFIERS.shift); + } + if (modifier !== 0) { return matchesKittySequence(data, codepoint, modifier); }