This commit is contained in:
Sijie Wang 2025-07-25 15:36:42 -07:00 committed by GitHub
parent aa71438684
commit fbdc8d5ab3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 5324 additions and 191 deletions

View file

@ -147,12 +147,15 @@ export function useKeypress(
let rl: readline.Interface;
if (usePassthrough) {
rl = readline.createInterface({ input: keypressStream });
rl = readline.createInterface({
input: keypressStream,
escapeCodeTimeout: 0,
});
readline.emitKeypressEvents(keypressStream, rl);
keypressStream.on('keypress', handleKeypress);
stdin.on('data', handleRawKeypress);
} else {
rl = readline.createInterface({ input: stdin });
rl = readline.createInterface({ input: stdin, escapeCodeTimeout: 0 });
readline.emitKeypressEvents(stdin, rl);
stdin.on('keypress', handleKeypress);
}