From c61a24b981345be9e09af5e1d870a01fba6d8eac Mon Sep 17 00:00:00 2001 From: Nihal Jere Date: Wed, 11 Nov 2020 18:27:50 -0600 Subject: [PATCH] install trap only if stdin is a tty --- pash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pash b/pash index 6e6b4ad..4180492 100755 --- a/pash +++ b/pash @@ -217,7 +217,7 @@ main() { # Ensure that we leave the terminal in a usable # state on exit or Ctrl+C. - trap 'stty echo icanon' INT EXIT + [ -t 1 ] && trap 'stty echo icanon' INT EXIT case $1 in a*) pw_add "$2" ;;