mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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:
parent
9b68d84656
commit
a8a86387fa
@ -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
|
||||
});
|
||||
|
8
test/parallel/test-stdout-stderr-write.js
Normal file
8
test/parallel/test-stdout-stderr-write.js
Normal 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);
|
Loading…
Reference in New Issue
Block a user