Skip to content

Commit f4dcdfa

Browse files
committed
tty: use blocking mode on OS X
Refs: nodejs#1771 Refs: nodejs#6456 Refs: nodejs#6773 Refs: nodejs#6816
1 parent b1a05eb commit f4dcdfa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/tty.js

+7
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ function WriteStream(fd) {
4848
writable: true
4949
});
5050

51+
// Prevents interleaved stdout/stderr output in OS X terminals.
52+
// As noted in the following reference, local TTYs tend to be quite fast and
53+
// this behaviour has become expected due historical functionality on OS X,
54+
// even though it was originally intended to change in v1.0.2 (Libuv 1.2.1).
55+
// Ref: https://github.com/nodejs/node/pull/1771#issuecomment-119351671
56+
if (process.platform === 'darwin') this._handle.setBlocking(true);
57+
5158
var winSize = [];
5259
var err = this._handle.getWindowSize(winSize);
5360
if (!err) {

0 commit comments

Comments
 (0)