This commit is contained in:
Sijie Wang
2025-07-25 15:36:42 -07:00
committed by GitHub
parent 4265457a57
commit 8b74a8ed8b
21 changed files with 5324 additions and 191 deletions
+5 -2
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);
}