From 14f6574318b66f7df4d8767c2c70ecb73c4ee26d Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Mon, 6 Jun 2022 10:04:18 -0400 Subject: [PATCH] Only listen for stdin close on TTYs (#8523) --- 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()