Skip to content

Commit

Permalink
Revert "tty: don't read from console stream upon creation"
Browse files Browse the repository at this point in the history
This reverts commit 4611389.

The offending commit broke certain usages of piping from stdin.

Fixes: #5927
PR-URL: #5947
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Alexis Campailla <orangemocha@nodejs.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
evanlucas committed Mar 29, 2016
1 parent 89abe86 commit b6475b9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,17 @@ function ReadStream(fd, options) {
if (!(this instanceof ReadStream))
return new ReadStream(fd, options);

// pauseOnCreate to avoid reading from the sytem buffer
options = util._extend({
highWaterMark: 0,
readable: true,
writable: false,
handle: new TTY(fd, true),
pauseOnCreate: true
handle: new TTY(fd, true)
}, options);

net.Socket.call(this, options);

this.isRaw = false;
this.isTTY = true;

// Let the stream resume automatically when 'data' event handlers
// are added, even though it was paused on creation
this._readableState.flowing = null;
}
inherits(ReadStream, net.Socket);

Expand Down

0 comments on commit b6475b9

Please sign in to comment.