From c33a9d77cd150c3bb9bf17a4267e5d2e7245374e Mon Sep 17 00:00:00 2001 From: anseki Date: Mon, 2 Mar 2015 02:00:20 +0900 Subject: [PATCH] Drop STDERR of `stty`. --- lib/read.sh | 9 +++++++-- package.json | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/read.sh b/lib/read.sh index ed6437d..2f4eafc 100644 --- a/lib/read.sh +++ b/lib/read.sh @@ -1,7 +1,12 @@ if [ "$1" = "noechoback" ]; then - stty --file=/dev/tty -echo echonl || stty -F /dev/tty -echo echonl || stty -f /dev/tty -echo echonl || exit 1 + stty --file=/dev/tty -echo echonl 2>/dev/null || \ + stty -F /dev/tty -echo echonl 2>/dev/null || \ + stty -f /dev/tty -echo echonl 2>/dev/null || \ + exit 1 IFS= read -r INPUT /dev/null || \ + stty -F /dev/tty echo -echonl 2>/dev/null || \ + stty -f /dev/tty echo -echonl 2>/dev/null # printf '\n' >/dev/tty else IFS= read -r INPUT