From 3b9fd1af804e4fe534798ec2d7da440d97ba610c Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Tue, 2 Apr 2024 15:55:06 -0600 Subject: fix(cli): Enforce a human delay in prompt to fix paste problem (#23184) The permission prompt doesn't wait for quiescent input, so someone pasting a large text file into the console may end up losing the prompt. We enforce a minimum human delay and wait for a 100ms quiescent period before we write and accept prompt input to avoid this problem. This does require adding a human delay in all prompt tests, but that's pretty straightforward. I rewrote the locked stdout/stderr test while I was in here. --- .../run/stdio_streams_are_locked_in_permission_prompt/worker.js | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 tests/testdata/run/stdio_streams_are_locked_in_permission_prompt/worker.js (limited to 'tests/testdata') diff --git a/tests/testdata/run/stdio_streams_are_locked_in_permission_prompt/worker.js b/tests/testdata/run/stdio_streams_are_locked_in_permission_prompt/worker.js deleted file mode 100644 index 287027c83..000000000 --- a/tests/testdata/run/stdio_streams_are_locked_in_permission_prompt/worker.js +++ /dev/null @@ -1,3 +0,0 @@ -setTimeout(() => { - console.log("Are you sure you want to continue?"); -}, 10); // ensure we don't output too quickly before the permission prompt -- cgit v1.2.3