fix(cli): resolve TTY hang on headless environments by unconditionally resuming process.stdin before React Ink launch (#23673)

This commit is contained in:
Coco Sheng
2026-03-25 14:18:43 -04:00
committed by GitHub
parent 0bb6c25dc7
commit 830f7dec61
4 changed files with 149 additions and 1 deletions
+9
View File
@@ -613,8 +613,17 @@ export async function main() {
}
cliStartupHandle?.end();
// Render UI, passing necessary config values. Check that there is no command line question.
if (config.isInteractive()) {
// Earlier initialization phases (like TerminalCapabilityManager resolving
// or authWithWeb) may have added and removed 'data' listeners on process.stdin.
// When the listener count drops to 0, Node.js implicitly pauses the stream buffer.
// React Ink's useInput hooks will silently fail to receive keystrokes if the stream remains paused.
if (process.stdin.isTTY) {
process.stdin.resume();
}
await startInteractiveUI(
config,
settings,