From 46a80f37734ff22fbc59035ac67997a5f93c6b4c Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Fri, 13 Mar 2026 00:48:19 +0100 Subject: [PATCH] fix: reopen stdin from terminal when script is piped --- setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index a6fd20f4..add36343 100644 --- a/setup.sh +++ b/setup.sh @@ -970,11 +970,6 @@ trap cleanup INT TERM # ── Main ──────────────────────────────────────────────────────────────────── main() { - # When piped (e.g. curl | bash), reopen stdin from the terminal - if [[ ! -t 0 ]]; then - exec < /dev/tty - fi - # Check for minimum terminal size get_term_size if [[ $TERM_COLS -lt 60 || $TERM_ROWS -lt 20 ]]; then @@ -1030,4 +1025,9 @@ load_existing_config() { get_env_val "LOGIN_WEBSITE_URL"; [[ -n "$val" ]] && CFG_LOGIN_WEBSITE_URL="$val" } -main "$@" +# When piped (e.g. curl | bash), reopen stdin from the terminal +if [[ -t 0 ]]; then + main "$@" +else + main "$@" < /dev/tty +fi