diff --git a/scripts/curl-install.sh b/scripts/curl-install.sh index 4c65476..a9d390c 100755 --- a/scripts/curl-install.sh +++ b/scripts/curl-install.sh @@ -21,4 +21,11 @@ fi cd "$HOME"/.dotfiles || exit -exec ./install.sh +# Reconnect stdin to the terminal so interactive prompts work correctly. +# When running via `bash <(curl ...)`, stdin may be the process substitution +# pipe rather than the terminal, causing read/select to receive EOF immediately. +if [ -t 0 ]; then + exec ./install.sh +else + exec ./install.sh < /dev/tty +fi diff --git a/scripts/install.sh b/scripts/install.sh index c6591a2..b2daff2 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -5,6 +5,14 @@ # Exit on error, undefined variables, and pipe failures set -euo pipefail +# Reconnect stdin to the terminal if it is not already a TTY. +# This is needed when the script is invoked via `bash <(curl ...)` where +# stdin may be the process substitution pipe instead of the terminal, +# causing interactive read/select calls to receive EOF immediately. +if [ ! -t 0 ] && [ -c /dev/tty ]; then + exec < /dev/tty +fi + ########################################### # GLOBAL VARIABLES ###########################################