From ab3306ad51d8136014aa0fa9278b57bb77105320 Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Thu, 14 Jul 2016 12:24:10 +0200 Subject: tty: set the handle to blocking mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/1771 Refs: https://github.com/nodejs/node/issues/6456 Refs: https://github.com/nodejs/node/pull/6773 Refs: https://github.com/nodejs/node/issues/7743 PR-URL: https://github.com/nodejs/node/pull/6816 Reviewed-By: Fedor Indutny Reviewed-By: Saúl Ibarra Corretgé Reviewed-By: Anna Henningsen Reviewed-By: Rod Vagg Reviewed-By: Michaël Zasso Reviewed-By: James M Snell --- lib/tty.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/tty.js') diff --git a/lib/tty.js b/lib/tty.js index fe0cc2e521..576144e401 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -48,12 +48,12 @@ function WriteStream(fd) { writable: true }); - // Prevents interleaved stdout/stderr output in OS X terminals. + // Prevents interleaved or dropped stdout/stderr output for terminals. // As noted in the following reference, local TTYs tend to be quite fast and // this behaviour has become expected due historical functionality on OS X, // even though it was originally intended to change in v1.0.2 (Libuv 1.2.1). // Ref: https://github.com/nodejs/node/pull/1771#issuecomment-119351671 - if (process.platform === 'darwin') this._handle.setBlocking(true); + this._handle.setBlocking(process.env.NODE_TTY_UNSAFE_ASYNC !== '1'); var winSize = []; var err = this._handle.getWindowSize(winSize); -- cgit v1.2.3