Skip to content

Route OpenCode/Pi install prompts through /dev/tty too - #10

Merged
winjer merged 1 commit into
mainfrom
fix-installer-tty-all-prompts
Jul 20, 2026
Merged

Route OpenCode/Pi install prompts through /dev/tty too#10
winjer merged 1 commit into
mainfrom
fix-installer-tty-all-prompts

Conversation

@winjer

@winjer winjer commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #9. The email prompt still didn't fire under curl -sfL .../install.sh | bash for anyone who has OpenCode or Pi installed.

Root cause: #9 fixed only the email prompt. The earlier "Install OpenCode/Pi plugin? [y/N]" prompts still ran read -p … -r reading from stdin — which under curl | bash is the pipe carrying the script. That read consumed the rest of the piped script and execution desynced, so create_config (and its /dev/tty email prompt) was never reached. Reproduced: the run stops right after "OpenCode detected… Install the code-trace plugin?" with no config written.

Fix: resolve the interactive input source once (resolve_tty_inTTY_IN) and route all three prompts through it — reading from the controlling terminal under curl | bash, and skipping the prompt entirely when no terminal exists (CI/unattended) rather than reading from the script pipe.

Verified (bash reading the script from a real pipe, controlling terminal via a pty):

  • OpenCode present, decline plugin → reaches email prompt, writes it ✓ (the reported case)
  • OpenCode present, accept plugin → installs, then email prompt ✓
  • Pi present → prompts, then email ✓
  • no controlling terminal (setsid/CI) → skips all prompts, does not hang ✓
  • no agents, blank email → skips, commented placeholder ✓

Existing installer hook-registration test still passes.

🤖 Generated with Claude Code

PR #9 made the email prompt read from /dev/tty, but a piped
curl | bash install still skipped it for anyone with OpenCode or Pi
installed. The "Install OpenCode/Pi plugin? [y/N]" prompts still read
from stdin — which under curl | bash is the script pipe — so that read
consumed the remaining script and execution desynced before
create_config (and its email prompt) ever ran.

Resolve the interactive input source once (resolve_tty_in -> TTY_IN) and
route all three prompts through it, reading from the controlling
terminal under curl | bash and skipping entirely when no terminal exists
(CI/unattended) instead of reading from the pipe.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@winjer
winjer merged commit b27b4b7 into main Jul 20, 2026
2 checks passed
@winjer
winjer deleted the fix-installer-tty-all-prompts branch July 20, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant