mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 15:31:27 +00:00
Merge pull request #1827 from QwenLM/feat/printable-csi-u-keys
feat: add support for printable CSI-u keys in KeypressContext
This commit is contained in:
commit
b0d929ec4c
2 changed files with 64 additions and 0 deletions
|
|
@ -332,6 +332,36 @@ export function KeypressProvider({
|
|||
};
|
||||
}
|
||||
|
||||
// Printable CSI-u keys (including space) should behave like regular
|
||||
// character input so downstream text inputs receive the literal char.
|
||||
if (
|
||||
terminator === 'u' &&
|
||||
!ctrl &&
|
||||
keyCode >= 32 &&
|
||||
keyCode !== 127 &&
|
||||
keyCode <= 0x10ffff
|
||||
) {
|
||||
const char = String.fromCodePoint(keyCode);
|
||||
const printableName =
|
||||
char === ' '
|
||||
? 'space'
|
||||
: /^[A-Za-z]$/.test(char)
|
||||
? char.toLowerCase()
|
||||
: char;
|
||||
return {
|
||||
key: {
|
||||
name: printableName,
|
||||
ctrl: false,
|
||||
meta: alt,
|
||||
shift,
|
||||
paste: false,
|
||||
sequence: char,
|
||||
kittyProtocol: true,
|
||||
},
|
||||
length: m[0].length,
|
||||
};
|
||||
}
|
||||
|
||||
// Ctrl+letters
|
||||
if (
|
||||
ctrl &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue