From 7636ddf9c9ec1396342f9fd6c181e40d924375e1 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Mon, 6 Jun 2022 09:48:48 -0400 Subject: [PATCH] Only listen for stdin close on TTYs --- src/cli.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli.js b/src/cli.js index 4bb35f76c12a..ad6cdf1c710e 100644 --- a/src/cli.js +++ b/src/cli.js @@ -875,8 +875,10 @@ async function build() { if (shouldWatch) { /* Abort the watcher if stdin is closed to avoid zombie processes */ - process.stdin.on('end', () => process.exit(0)) - process.stdin.resume() + if (process.stdin.isTTY) { + process.stdin.on('end', () => process.exit(0)) + process.stdin.resume() + } startWatcher() } else { buildOnce()