Fix #563: install script fails when piped via curl if tmux is missing#565
Open
asheshgoplani wants to merge 2 commits intomainfrom
Open
Fix #563: install script fails when piped via curl if tmux is missing#565asheshgoplani wants to merge 2 commits intomainfrom
asheshgoplani wants to merge 2 commits intomainfrom
Conversation
The setup wizard welcome step says "Press Esc to use defaults" but pressing Esc did nothing because prevStep() has no action for the welcome step. Now Esc on the welcome step completes the wizard with default configuration, matching the documented behavior. Committed by Ashesh Goplani
When running `curl ... | bash`, the `read` commands consume bytes from stdin (the pipe) instead of the terminal, corrupting script execution. This causes the script to install tmux but exit before installing the agent-deck binary, requiring a second run. Two fixes applied: - Wrap entire script in main() so bash reads it fully before executing - Add prompt_read() helper that redirects reads to /dev/tty when piped Fixes #563 Committed by Ashesh Goplani
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.
Summary
install.shin amain()function so bash reads the full script before executing, preventing partial runs when connection drops duringcurl | bashprompt_read()helper that redirects interactivereadcommands to/dev/ttywhen stdin is piped, so prompts work correctly instead of consuming script bytesRoot cause
When running
curl -fsSL ... | bash, stdin is the pipe. Theread -pcommands either consume bytes meant for bash to parse (corrupting execution) or hit EOF and return non-zero (triggeringset -e). Either way, the script installs tmux but exits before installing the agent-deck binary.Test plan
curl -fsSL https://raw.githubusercontent.com/.../install.sh | bashworks on a machine without tmuxbash install.shstill works when run directly (not piped)curl ... | bash -- --non-interactiveworks in headless/CI environmentsbash -n install.shpasses (syntax check)Fixes #563