fix: handle Shift+Space in Kitty keyboard protocol terminals (#15767)

This commit is contained in:
Tu Shaokun
2026-01-10 01:28:14 +08:00
committed by GitHub
parent 8bc3cfe29a
commit c1401682ed
2 changed files with 33 additions and 8 deletions
@@ -84,6 +84,7 @@ const KEY_INFO_MAP: Record<
'[9u': { name: 'tab' },
'[13u': { name: 'return' },
'[27u': { name: 'escape' },
'[32u': { name: 'space' },
'[127u': { name: 'backspace' },
'[57414u': { name: 'return' }, // Numpad Enter
'[a': { name: 'up', shift: true },
@@ -479,6 +480,10 @@ function* emitKeys(
if (keyInfo.ctrl) {
ctrl = true;
}
if (name === 'space' && !ctrl && !meta) {
sequence = ' ';
insertable = true;
}
} else {
name = 'undefined';
if ((ctrl || meta) && (code.endsWith('u') || code.endsWith('~'))) {