install trap only if stdin is a tty
This commit is contained in:
parent
49b7087890
commit
c61a24b981
2
pash
2
pash
|
@ -217,7 +217,7 @@ main() {
|
||||||
|
|
||||||
# Ensure that we leave the terminal in a usable
|
# Ensure that we leave the terminal in a usable
|
||||||
# state on exit or Ctrl+C.
|
# state on exit or Ctrl+C.
|
||||||
trap 'stty echo icanon' INT EXIT
|
[ -t 1 ] && trap 'stty echo icanon' INT EXIT
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
a*) pw_add "$2" ;;
|
a*) pw_add "$2" ;;
|
||||||
|
|
Loading…
Reference in New Issue