Skip to content

Commit

Permalink
cleanup(): Only print a clean line after restoring a hidden prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Dec 14, 2023
1 parent 8fc2f89 commit 01ede8a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -893,14 +893,17 @@ Temporary session not preserved."
# shellcheck disable=SC3040 # POSIX set - cleanup()
case "$prompt_restore" in
0) : ;; # Not required
1) [ -t 1 ] && stty echo ;;
2) set -o echo ;;
1)
[ -t 1 ] && stty echo
[ "$EASYRSA_SILENT" ] || print
;;
2)
set -o echo
[ "$EASYRSA_SILENT" ] || print
;;
*) warn "prompt_restore: '$prompt_restore'"
esac

# Get a clean line
[ "$EASYRSA_SILENT" ] || print

# Clear traps
trap - 0 1 2 3 6 15

Expand Down

0 comments on commit 01ede8a

Please sign in to comment.