Skip to content

Commit 2498e29

Browse files
silverwindFishrock123
authored andcommitted
src: Revert "nix stdin _readableState.reading"
This reverts 8cee8f5 which was causing stdin to behave strangely on Windows 8 and 10. The suspected explanation for the issue is that there might be a race condition occuring when stdin._readableState.reading is set indirectly through `push('')`. PR-URL: #3490 Fixes: #2996 Fixes: #2504 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1 parent b663d2b commit 2498e29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@
726726
// not-reading state.
727727
if (stdin._handle && stdin._handle.readStop) {
728728
stdin._handle.reading = false;
729-
stdin.push('');
729+
stdin._readableState.reading = false;
730730
stdin._handle.readStop();
731731
}
732732

@@ -735,7 +735,7 @@
735735
stdin.on('pause', function() {
736736
if (!stdin._handle)
737737
return;
738-
stdin.push('');
738+
stdin._readableState.reading = false;
739739
stdin._handle.reading = false;
740740
stdin._handle.readStop();
741741
});

0 commit comments

Comments
 (0)