Skip to content

Fix uninstall.sh crash when executed via curl | sudo bash#7

Merged
SolverNA merged 2 commits into
masterfrom
copilot/fix-syntax-error-in-uninstall-script
Apr 23, 2026
Merged

Fix uninstall.sh crash when executed via curl | sudo bash#7
SolverNA merged 2 commits into
masterfrom
copilot/fix-syntax-error-in-uninstall-script

Conversation

Copilot AI commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

When piped into bash, uninstall.sh failed with a syntax error around line 79 because interactive read calls were competing with the script stream on stdin.

Changes

  • Dedicated TTY descriptor — open /dev/tty once into a named FD at startup; fall back to empty string on failure:
    TTY_FD=""
    exec {TTY_FD}</dev/tty 2>/dev/null || TTY_FD=""
  • Isolated prompt readsask_yes_no reads from <&$TTY_FD instead of stdin, eliminating stream contention
  • Numeric FD guard — validate $TTY_FD =~ ^[0-9]+$ before any redirection or close to prevent unexpected expansion
  • Explicit cleanup — close the descriptor before exit

@SolverNA SolverNA marked this pull request as ready for review April 23, 2026 02:37
@SolverNA SolverNA merged commit f3d9b25 into master Apr 23, 2026
1 check passed
@SolverNA SolverNA deleted the copilot/fix-syntax-error-in-uninstall-script branch April 23, 2026 02:37
SolverNA added a commit that referenced this pull request Apr 24, 2026
…tall-script

Fix uninstall.sh crash when executed via `curl | sudo bash`
SolverNA added a commit that referenced this pull request Apr 24, 2026
…tall-script

Fix uninstall.sh crash when executed via `curl | sudo bash`
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.

2 participants