Skip to content

Conversation

@ai-tesi
Copy link
Contributor

@ai-tesi ai-tesi commented Jan 27, 2026

Summary

  • Detect non-interactive mode (curl | bash) and skip optional prompts

Problem

When running:

curl -sSL https://raw.githubusercontent.com/mbailey/metool/master/install.sh | bash

The installer blocks at the bash-completion prompt because stdin is not a tty.

Solution

Detect non-interactive mode at script start:

INTERACTIVE=true
if [[ ! -t 0 ]]; then
    INTERACTIVE=false
fi

Then skip optional prompts when non-interactive, using sensible defaults (skip bash-completion since it's optional).

Testing

Tested on macOS Tahoe (arm64) fresh VM with:

  • curl -sSL ... | bash - now proceeds without blocking
  • ./install.sh (interactive) - still prompts as expected

🤖 Generated with Claude Code

When running via `curl | bash`, stdin is not a tty, so interactive
prompts block forever. Detect non-interactive mode and skip optional
prompts (like bash-completion) with sensible defaults.

Changes:
- Add INTERACTIVE flag based on tty detection
- Skip bash-completion prompt in non-interactive mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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