Skip to content

Commit

Permalink
fix: only set timeout for TTY
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Feb 22, 2024
1 parent fa66417 commit 8a97f20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli-ux/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ function normal(options: IPromptConfig, retries = 100): Promise<string> {
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',
Expand Down

0 comments on commit 8a97f20

Please sign in to comment.