fix(install): reconnect stdin to tty for interactive TUI in piped execution

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-09-06 17:16:50 +02:00
co-authored by Junie
parent c219988011
commit e87342d3b7
+4 -4
View File
@@ -130,12 +130,12 @@ main() {
fi
setup_cmd+=(./setup.sh "$@")
# Execute setup.sh with stdin connected to /dev/tty if stdin is piped (e.g. curl ... | bash)
# Reconnect stdin to /dev/tty before executing setup.sh if piped (e.g. curl ... | bash)
if [[ ! -t 0 ]] && [[ -e /dev/tty ]] && ( : < /dev/tty ) 2>/dev/null; then
"${setup_cmd[@]}" < /dev/tty
else
"${setup_cmd[@]}"
exec < /dev/tty
fi
"${setup_cmd[@]}"
}
main "$@"