Skip to content

fix: restore interactive prompts during installation#18

Merged
glauberlima merged 1 commit intomainfrom
fix/is-piped-stderr-check
Feb 23, 2026
Merged

fix: restore interactive prompts during installation#18
glauberlima merged 1 commit intomainfrom
fix/is-piped-stderr-check

Conversation

@glauberlima
Copy link
Copy Markdown
Owner

Summary

  • Fixes a regression introduced in fix: enable prompts when installing via curl|bash #16 where is_piped() checked stdout (fd 1), causing all interactive prompts (language and component selection) to be silently skipped
  • Root cause: prompt functions are called inside $(...) command substitutions, where stdout is always a pipe — so [[ ! -t 1 ]] always returned true, even in a real terminal
  • Fix: check stderr (fd 2) instead, which is inherited through subshells and correctly reflects the parent's tty state

Behavior across scenarios

Scenario Before (fd 1) After (fd 2)
./install.sh in terminal ❌ skips prompts ✅ shows prompts
curl url | bash ❌ skips prompts ✅ shows prompts
CI / ./install.sh > log 2>&1 ✅ skips prompts ✅ skips prompts

Test plan

  • Run ./install.sh locally and confirm language + component selection prompts appear
  • Run ./tests/shellcheck.sh — all checks pass

`is_piped()` was checking stdout (fd 1), but prompt functions are called
inside `$(...)` command substitutions where stdout is always a pipe.
This caused every interactive prompt to be silently skipped.

Switching to stderr (fd 2) fixes the regression: stderr is inherited
through subshells unchanged, correctly reflecting whether a real terminal
is present in all scenarios (direct run, curl|bash, CI/redirect).
@glauberlima glauberlima merged commit 02d0640 into main Feb 23, 2026
1 check passed
@glauberlima glauberlima deleted the fix/is-piped-stderr-check 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