Skip to content

Commit 5535688

Browse files
committed
fix(inquirerer): apply inactivity timeout to all environments, not just non-TTY
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.
1 parent 76f01d3 commit 5535688

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

packages/inquirerer/src/prompt.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export class Inquirerer {
250250

251251
if (timeout !== undefined) {
252252
this.timeout = timeout;
253-
} else if (!noTty && !(input as any).isTTY) {
253+
} else if (!noTty) {
254254
this.timeout = DEFAULT_NON_TTY_TIMEOUT;
255255
}
256256

@@ -1469,8 +1469,7 @@ export class Inquirerer {
14691469
lines.push('');
14701470
lines.push(`PROMPT TIMEOUT: No input received for "${currentQuestion.name}" after ${seconds}s.`);
14711471
lines.push('');
1472-
lines.push('This usually happens when running in a non-interactive environment');
1473-
lines.push('(CI, scripts, AI agents) without the proper flags.');
1472+
lines.push('No input was received before the inactivity timeout.');
14741473
lines.push('');
14751474
lines.push('REQUIRED ARGUMENTS:');
14761475

@@ -1508,9 +1507,9 @@ export class Inquirerer {
15081507
lines.push(' 3. Or pass --no-tty if the CLI supports it.');
15091508
lines.push('');
15101509
lines.push('WHY THIS HAPPENED:');
1511-
lines.push(' The prompt expected interactive TTY input (keyboard), but no input');
1512-
lines.push(' was received. AI agents and CI pipelines must pass arguments via');
1513-
lines.push(' CLI flags instead of interactive prompts.');
1510+
lines.push(' The prompt waited for input but none was received within the');
1511+
lines.push(' timeout window. Pass the required arguments as CLI flags');
1512+
lines.push(' to avoid interactive prompts.');
15141513
lines.push('');
15151514

15161515
return lines.join('\n');

0 commit comments

Comments
 (0)