Skip to content

fix: enable prompts when installing via curl|bash#16

Merged
glauberlima merged 2 commits intomainfrom
fix/make-install-sh-executable
Feb 20, 2026
Merged

fix: enable prompts when installing via curl|bash#16
glauberlima merged 2 commits intomainfrom
fix/make-install-sh-executable

Conversation

@glauberlima
Copy link
Copy Markdown
Owner

Summary

  • is_piped() checked stdin (-t 0) to decide whether to show interactive prompts
  • When running via curl ... | bash, stdin is the pipe carrying the script — so prompts were silently skipped and defaults applied
  • Fix: check stdout (-t 1) instead, which remains a tty in the curl|bash scenario

Root Cause

# Before — stdin-based (wrong for curl|bash)
is_piped() { [[ ! -t 0 ]]; }

# After — stdout-based (correct signal: is a human watching?)
is_piped() { [[ ! -t 1 ]]; }

The read calls already use /dev/tty so they can handle piped stdin — the guard was the only thing blocking the prompts.

Behaviour Matrix

Scenario stdout fd 1 Result
curl ... | bash IS a tty shows prompts ✓
./install.sh IS a tty shows prompts ✓
CI / ./install.sh > log NOT a tty uses defaults silently ✓
./install.sh | tee log NOT a tty uses defaults silently ✓

Test plan

  • bash <(cat install.sh) — language and component menus appear
  • ./install.sh > /tmp/log.txt 2>&1 — prompts skipped, defaults used
  • ./install.sh — interactive flow unchanged
  • ./tests/shellcheck.sh passes (verified ✓)

When running via `curl ... | bash`, stdin is the pipe carrying the
script, so checking `[[ ! -t 0 ]]` incorrectly suppressed the language
and component selection menus. Stdout remains a tty in that scenario,
making `[[ ! -t 1 ]]` the correct signal that a human is watching and
can respond to prompts.

CI/redirect scenarios (`./install.sh > log`) still suppress prompts
correctly since stdout is not a tty there.
@glauberlima glauberlima merged commit 64b6934 into main Feb 20, 2026
1 check passed
@glauberlima glauberlima deleted the fix/make-install-sh-executable branch March 6, 2026 11: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