-
-
Notifications
You must be signed in to change notification settings - Fork 37.3k
[Windows] process.stdin.unref doesn't work #22999
Copy link
Copy link
Closed
Labels
libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
Activity
Metadata
Metadata
Assignees
Labels
libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
parent.js
child.js
Run with
node parent.jsResults
Linux: The process terminates by itself
Mac: The process terminates by itself
Windows: The process keeps running until Enter is pressed
This strange behavior seems to break some npm modules.
Other details
Adding
process.stdin.removeListener('data', doNothing)or
process.stdin.removeAllListeners('data')before
unrefdoesn't make any difference.When enter is pressed, it doesn't trigger
datacallback, just terminates the process.Edit
Simplified code:
Here we don't have a child process. Run with
node parent.jsResults on windows
50% of times - the process exits
50% of times - the process keeps running