From cccb59dd0029243d816cd1a07ffa1f4b3ed25313 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 6 Jan 2021 10:38:53 +0000 Subject: [PATCH] fix: redirect help Fixes: #1807 Allows for nodemon --help > help.txt Signed-off-by: rpm-build --- lib/nodemon.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/nodemon.js b/lib/nodemon.js index b3badea..ce649cb 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); -- 2.31.1