node icon indicating copy to clipboard operation
node copied to clipboard

Node process freezes when text is selected in command line

Open reverofevil opened this issue 4 years ago • 7 comments

  • Version: v16.2.0
  • Platform: Windows 10
  • Subsystem: -

What steps will reproduce the bug?

  • Run any Node.js script: an http-server or long-running npm install.
  • Select text in console window.

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

Node process should never freeze due to text selection in terminal, same as desktop application UI threads should never stop execution of application.

What do you see instead?

Server doesn't respond to requests, npm installation freezes. Whole node process does nothing.

Additional information

This is Windows-specific problem that I encountered by interacting with terminal window in a different way more than 3 years ago. Given that it's very easy to start selection on Windows just by clicking a terminal window (while switching windows, for example), it's very common to find a long-running script doing nothing after several minutes of waiting for progress. I think this is a serious UX issue.

reverofevil avatar Jun 13 '21 22:06 reverofevil

@nodejs/platform-windows

Trott avatar Jun 13 '21 22:06 Trott

This seems to only happen with conhost.exe.

targos avatar Jun 14 '21 06:06 targos

Hi All, I am interested with node process object, can I pick this up for investigation?

nikikalwar avatar Jun 17 '21 09:06 nikikalwar

@reverofevil I was not able to reproduce the issue with the latest versions of Node.js (23.2.0, 22.10.0, 20.18.0, and 18.20.4). Do you think this can be closed now?

huseyinacacak-janea avatar Nov 22 '24 13:11 huseyinacacak-janea

@huseyinacacak-janea

I'll check today.

reverofevil avatar Nov 23 '24 13:11 reverofevil

Naturally, nothing changed, and it's easily reproducible with a linked example on Node 22.10.0, Windows 10, cmd terminal.

reverofevil avatar Dec 02 '24 00:12 reverofevil

This issue might be related to how the console displays the output as stated in this comment because in the link that you've sent, the counter increases without any problem.

I've attached my screen record to make sure I did the tests correctly. agl41zww

huseyinacacak-janea avatar Dec 04 '24 15:12 huseyinacacak-janea

The test seems to be done correctly, except I'd recommend selecting the text for over 10 seconds, as well as holding scrollbar for longer. First 2 lines might come through just fine, and there actually was a suspicious lag at 5-6 second mark.

That said, I don't recognize this terminal.

reverofevil avatar Dec 06 '24 04:12 reverofevil

This is the default CMD of Windows 11. Can you record your screen and share it here?

huseyinacacak-janea avatar Dec 12 '24 08:12 huseyinacacak-janea

Since the issue has been stale for some time, and in addition it doesn't look like anything Node specific, I'll close it. Feel free to reopen if needed.

StefanStojanovic avatar Mar 04 '25 12:03 StefanStojanovic

Image

doesn't look like anything Node specific

This is Node-specific bug in implementation of console.* methods.

reverofevil avatar Mar 04 '25 19:03 reverofevil