Route OpenCode/Pi install prompts through /dev/tty too - #10
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #9. The email prompt still didn't fire under
curl -sfL .../install.sh | bashfor 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 … -rreading from stdin — which undercurl | bashis the pipe carrying the script. Thatreadconsumed the rest of the piped script and execution desynced, socreate_config(and its/dev/ttyemail 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_in→TTY_IN) and route all three prompts through it — reading from the controlling terminal undercurl | 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):
Existing installer hook-registration test still passes.
🤖 Generated with Claude Code