-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double keypress in readline / process.stdin #25875
Comments
@nodejs/libuv @nodejs/repl |
@Ezekiel-DA Can you try changing that logging line to use I get:
The libuv change However, I am quite sure this is not a bug. The Node.js internally uses this functionality to condense stdio connection events into what we would expect -- keypresses. That isn't directly exposed but is used in The resulting output from the
... I don't really know why this event is emitted where it is and why it is not documented, but this is what you should use, I think. |
@Fishrock123 Thanks for looking into this! The only reason I listen to 'data' is to try and find a minimal reproduction for a change in behavior that impacts Inquirer (see SBoudrias/Inquirer.js#778) and appeared when libuv was upgraded to 1.25.0. I'm pretty sure I found the source of the problem in libuv, and I opened libuv/libuv#2168. As you can see there, the specific scenario of Windows, special keys (e.g. down arrow here) hits a regression that produces an even for both key down and key up, which I'm pretty sure is not the desired behavior! |
As a data point, I can also reproduce this issue and has been happening since last Node.js upgrade (Windows 10 x64 1809). |
Word on the street is that libuv/libuv#2160 will fix the issue. |
Refs: #2114 Refs: nodejs/node#25875 Refs: nodejs/node#26013 Fixes: #2168 PR-URL: #2160 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Notable changes: - A bug that could result in 100% CPU utilization in Node has been fixed (libuv/libuv#2162) - Node's report module will now include the entire Windows product name (libuv/libuv#2170) PR-URL: nodejs#26037 Fixes: nodejs#26013 Fixes: nodejs#25875 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Notable changes: - A bug that could result in 100% CPU utilization in Node has been fixed (libuv/libuv#2162) - Node's report module will now include the entire Windows product name (libuv/libuv#2170) PR-URL: #26037 Fixes: #26013 Fixes: #25875 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Refs: libuv#2114 Refs: nodejs/node#25875 Refs: nodejs/node#26013 Fixes: libuv#2168 PR-URL: libuv#2160 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Notable changes: - A bug that could result in 100% CPU utilization in Node has been fixed (libuv/libuv#2162) - Node's report module will now include the entire Windows product name (libuv/libuv#2170) PR-URL: nodejs#26037 Fixes: nodejs#26013 Fixes: nodejs#25875 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Notable changes: - A bug that could result in 100% CPU utilization in Node has been fixed (libuv/libuv#2162) - Node's report module will now include the entire Windows product name (libuv/libuv#2170) Backport-PR-URL: #27728 PR-URL: #26037 Fixes: #26013 Fixes: #25875 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Refs: libuv#2114 Refs: nodejs/node#25875 Refs: nodejs/node#26013 Fixes: libuv#2168 PR-URL: libuv#2160 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> (cherry picked from commit 7ed1ece)
Refs: libuv#2114 Refs: nodejs/node#25875 Refs: nodejs/node#26013 Fixes: libuv#2168 PR-URL: libuv#2160 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> (cherry picked from commit 7ed1ece)
Refs: libuv#2114 Refs: nodejs/node#25875 Refs: nodejs/node#26013 Fixes: libuv#2168 PR-URL: libuv#2160 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> (cherry picked from commit 7ed1ece)
Refs: libuv#2114 Refs: nodejs/node#25875 Refs: nodejs/node#26013 Fixes: libuv#2168 PR-URL: libuv#2160 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> (cherry picked from commit 7ed1ece)
This code produces repeated output:
Run this with Node 11.8.0 or above and press the down arrow; two messages are produced:
Revert to Node 11.7.0, a single message is produced.
This breaks, among many things, scrolling through menus in Inquirer.js: SBoudrias/Inquirer.js#778
This appears to be Windows specific (as far as I could tell, I was only able to test on a Linux VM via Docker right now).
Git bisect tells me this issue first appeared with c0859d7, which upgraded
libuv
to1.25.0
.I'll keep digging into libuv (I already have an idea of where the problem was introduced in 1.25.0) but since this impacts Node on Windows somehwat significantly I figured it would be useful to have a way to track this!
The text was updated successfully, but these errors were encountered: