From 35fc16ce091d4e3e6720609f9b6625d3e8a310d3 Mon Sep 17 00:00:00 2001 From: Tad Hardesty Date: Fri, 18 Feb 2022 19:34:26 -0800 Subject: [PATCH] Only redirect from /dev/tty if stdin is not already a tty --- rustup-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustup-init.sh b/rustup-init.sh index 91d93f94d4..25ebc940d3 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -135,7 +135,7 @@ main() { exit 1 fi - if [ "$need_tty" = "yes" ]; then + if [ "$need_tty" = "yes" ] && [ ! -t 0 ]; then # The installer is going to want to ask for confirmation by # reading stdin. This script was piped into `sh` though and # doesn't have stdin to pass to its children. Instead we're going