tty: enable buffering

HWM was set to 0 which would cause e.g. stdout.write(...) to
always return false.

Refs: https://github.com/nodejs/node/pull/39246

PR-URL: https://github.com/nodejs/node/pull/39253
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Robert Nagy 2021-07-03 22:10:21 +02:00
parent 9b68d84656
commit a8a86387fa
2 changed files with 10 additions and 2 deletions

View File

@ -57,7 +57,7 @@ function ReadStream(fd, options) {
}
net.Socket.call(this, {
highWaterMark: 0,
readableHighWaterMark: 0,
handle: tty,
manualStart: true,
...options
@ -94,7 +94,7 @@ function WriteStream(fd) {
}
net.Socket.call(this, {
highWaterMark: 0,
readableHighWaterMark: 0,
handle: tty,
manualStart: true
});

View File

@ -0,0 +1,8 @@
'use strict';
require('../common');
const assert = require('assert');
// https://github.com/nodejs/node/pull/39246
assert.strictEqual(process.stderr.write('asd'), true);
assert.strictEqual(process.stdout.write('asd'), true);