From 8a97f2087d07290474d9bf224057322ae2abe4bc Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Thu, 22 Feb 2024 09:38:24 -0700 Subject: [PATCH] fix: only set timeout for TTY --- src/cli-ux/prompt.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli-ux/prompt.ts b/src/cli-ux/prompt.ts index 0befdb805..7735b357c 100644 --- a/src/cli-ux/prompt.ts +++ b/src/cli-ux/prompt.ts @@ -36,7 +36,8 @@ function normal(options: IPromptConfig, retries = 100): Promise { output: process.stdout, }) let timeout: NodeJS.Timeout - if (options.timeout) { + // Only set the timeout if the input is a TTY + if (options.timeout && process.stdin.isTTY) { timeout = setTimeout(() => ac.abort(), options.timeout) signal.addEventListener( 'abort',