install trap only if stdin is a tty

This commit is contained in:
Nihal Jere 2020-11-11 18:27:50 -06:00
parent 49b7087890
commit c61a24b981
1 changed files with 1 additions and 1 deletions

2
pash
View File

@ -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" ;;