From 55356882991df1148f2198fa7e618a4808910c8e Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 28 Jun 2026 05:38:45 +0000 Subject: [PATCH] fix(inquirerer): apply inactivity timeout to all environments, not just non-TTY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The timeout was gated behind `!input.isTTY`, so it only fired in non-TTY environments (CI, pipes). This meant running a CLI command from a real terminal without required arguments would show an interactive prompt instead of timing out with usage info. Remove the isTTY guard so the timeout applies universally. The reset-on-keypress design already protects interactive users — the timer resets on every keystroke, so it only fires when nobody is typing. --- packages/inquirerer/src/prompt.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/inquirerer/src/prompt.ts b/packages/inquirerer/src/prompt.ts index c686e9c..0011284 100644 --- a/packages/inquirerer/src/prompt.ts +++ b/packages/inquirerer/src/prompt.ts @@ -250,7 +250,7 @@ export class Inquirerer { if (timeout !== undefined) { this.timeout = timeout; - } else if (!noTty && !(input as any).isTTY) { + } else if (!noTty) { this.timeout = DEFAULT_NON_TTY_TIMEOUT; } @@ -1469,8 +1469,7 @@ export class Inquirerer { lines.push(''); lines.push(`PROMPT TIMEOUT: No input received for "${currentQuestion.name}" after ${seconds}s.`); lines.push(''); - lines.push('This usually happens when running in a non-interactive environment'); - lines.push('(CI, scripts, AI agents) without the proper flags.'); + lines.push('No input was received before the inactivity timeout.'); lines.push(''); lines.push('REQUIRED ARGUMENTS:'); @@ -1508,9 +1507,9 @@ export class Inquirerer { lines.push(' 3. Or pass --no-tty if the CLI supports it.'); lines.push(''); lines.push('WHY THIS HAPPENED:'); - lines.push(' The prompt expected interactive TTY input (keyboard), but no input'); - lines.push(' was received. AI agents and CI pipelines must pass arguments via'); - lines.push(' CLI flags instead of interactive prompts.'); + lines.push(' The prompt waited for input but none was received within the'); + lines.push(' timeout window. Pass the required arguments as CLI flags'); + lines.push(' to avoid interactive prompts.'); lines.push(''); return lines.join('\n');