From ac0b55e50a3c48a6ec1b15265d466cee3b83ef3d Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 6 Jan 2021 14:59:30 +0000 Subject: [PATCH] fix: redirect help (#1825) Fixes: #1807 Allows for nodemon --help > help.txt --- lib/nodemon.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/nodemon.js b/lib/nodemon.js index b3badea7..ce649cb6 100644 --- a/lib/nodemon.js +++ b/lib/nodemon.js @@ -39,7 +39,9 @@ function nodemon(settings) { } if (settings.help) { - process.stdout._handle.setBlocking(true); // nodejs/node#6456 + if (process.stdout.isTTY) { + process.stdout._handle.setBlocking(true); // nodejs/node#6456 + } console.log(help(settings.help)); if (!config.required) { process.exit(0);