From 01ede8aff2aca6a004102e61d24331379f8ab419 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Thu, 14 Dec 2023 22:17:03 +0000 Subject: [PATCH] cleanup(): Only print a clean line after restoring a hidden prompt Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index fe2e1497e..b6aa434dd 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -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