fix: test fix
This commit is contained in:
parent
b01ddf0aed
commit
6dad6b7f31
1 changed files with 6 additions and 0 deletions
|
|
@ -98,8 +98,14 @@ export function KeypressProvider({
|
||||||
const keypressStream = new PassThrough();
|
const keypressStream = new PassThrough();
|
||||||
let usePassthrough = false;
|
let usePassthrough = false;
|
||||||
const nodeMajorVersion = parseInt(process.versions.node.split('.')[0], 10);
|
const nodeMajorVersion = parseInt(process.versions.node.split('.')[0], 10);
|
||||||
|
const isWindows = process.platform === 'win32';
|
||||||
|
// On Windows, Node's readline keypress stream often loses bracketed paste
|
||||||
|
// boundaries, causing multi-line pastes to be delivered as plain Return
|
||||||
|
// key events. This leads to accidental submits on Enter within pasted text.
|
||||||
|
// Force passthrough on Windows to parse raw bytes and detect ESC[200~...201~.
|
||||||
if (
|
if (
|
||||||
nodeMajorVersion < 20 ||
|
nodeMajorVersion < 20 ||
|
||||||
|
isWindows ||
|
||||||
process.env['PASTE_WORKAROUND'] === '1' ||
|
process.env['PASTE_WORKAROUND'] === '1' ||
|
||||||
process.env['PASTE_WORKAROUND'] === 'true'
|
process.env['PASTE_WORKAROUND'] === 'true'
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue