Skip to content

Commit a8a8638

Browse files
committedJul 7, 2021
tty: enable buffering
HWM was set to 0 which would cause e.g. stdout.write(...) to always return false. Refs: nodejs#39246 PR-URL: nodejs#39253 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent 9b68d84 commit a8a8638

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
 

‎lib/tty.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function ReadStream(fd, options) {
5757
}
5858

5959
net.Socket.call(this, {
60-
highWaterMark: 0,
60+
readableHighWaterMark: 0,
6161
handle: tty,
6262
manualStart: true,
6363
...options
@@ -94,7 +94,7 @@ function WriteStream(fd) {
9494
}
9595

9696
net.Socket.call(this, {
97-
highWaterMark: 0,
97+
readableHighWaterMark: 0,
9898
handle: tty,
9999
manualStart: true
100100
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
require('../common');
4+
const assert = require('assert');
5+
6+
// https://github.com/nodejs/node/pull/39246
7+
assert.strictEqual(process.stderr.write('asd'), true);
8+
assert.strictEqual(process.stdout.write('asd'), true);

0 commit comments

Comments
 (0)