Skip to content

Commit

Permalink
feat: add an isTTY check
Browse files Browse the repository at this point in the history
This prevents the code from having a negative impact on piped stdio.

Refs: nodejs/node#6456 (comment)
Refs: nodejs/node#1771 (comment)
  • Loading branch information
Fishrock123 committed May 17, 2016
1 parent 7d0c45e commit 50944ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function (blocking) {
[process.stdout, process.stderr].forEach(function (stream) {
if (stream._handle && typeof stream._handle.setBlocking === 'function') {
if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') {
stream._handle.setBlocking(blocking)
}
})
Expand Down

0 comments on commit 50944ba

Please sign in to comment.