Repository navigation
fix: skip init prompts when stdin is not a TTY - #16
Conversation
88d4de1 to
b61b84f
Compare
b61b84f to
3193004
Compare
|
Review — not ready to merge yet. 1. Retarget to 2. CI fails — existing init tests break. 7 failures on These tests type answers through a fake 3. Non-TTY coverage is incomplete. Only Description/Author and the overwrite prompt are guarded. With stdin not a TTY and the args omitted, these still block on
Simplest fix: guard inside ~sent from claude-code |
Studio and CI inherit an open stdin that never writes, so Description/Author readline hung generate. Use defaults off-TTY and refuse overwrite without a prompt.
The first fix only covered Description/Author and the overwrite prompt. Project name, template choice and "Install dependencies" still blocked on the inherited stdin Studio and CI pass. Move the TTY check into _prompt and _prompt_yes_no so every prompt answers with its default off-TTY, and echo the default so the log shows what was chosen. Overwrite still exits 1. Tests that script answers through StringIO now use a stdin that reports a TTY, and new tests cover init with no arguments on an open, unused stdin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3193004 to
35fa72b
Compare
Summary
nitrostack-py initblocked onreadline()when stdin is inherited but never written (NitroStudio generate step 4 of 5, CI). Every prompt now answers with its default when stdin is not a TTY.Tests that script answers through
io.StringIOnow use a stdin that reports a TTY.Evidence
init --skip-installwith no name/template on an open, unused stdin →TimeoutError: CLI hung for 20.0s;test_prompts_return_defaults_without_ttyfails; 9 existingtest_cli.pyinit tests fail.tests/test_cli_studio_noninteractive.py(3 subprocess cases, stdin PIPE never written) andtest_prompts_return_defaults_without_ttypass; full suite 1342 passed locally.Merge Danger
Door: two-way
Blast Radius: CLI
Off-TTY,
initwithout--skip-installnow installs dependencies (the prompt's default is Yes) instead of hanging. Studio already passes--skip-install. Interactive terminals are unchanged.🤖 Generated with Claude Code