Make PASTE_WORKAROUND the default. (#12008)

This commit is contained in:
Tommaso Sciortino
2025-10-24 19:55:13 -07:00
committed by GitHub
parent ce26b58f09
commit ef70e63230
4 changed files with 11 additions and 36 deletions
@@ -481,19 +481,8 @@ export function useKeypressContext() {
return context;
}
/**
* Determines if the passthrough stream workaround should be used.
* This is necessary for Node.js versions older than 20 or when the
* PASTE_WORKAROUND environment variable is set, to correctly handle
* paste events.
*/
function shouldUsePassthrough(): boolean {
const nodeMajorVersion = parseInt(process.versions.node.split('.')[0], 10);
return (
nodeMajorVersion < 20 ||
process.env['PASTE_WORKAROUND'] === '1' ||
process.env['PASTE_WORKAROUND'] === 'true'
);
return process.env['PASTE_WORKAROUND'] !== 'false';
}
export function KeypressProvider({