From 6b8bb979229c3cb94fa9793e3510685f4b2d1e6b Mon Sep 17 00:00:00 2001 From: MacRimi Date: Fri, 11 Sep 2026 09:17:36 +0200 Subject: [PATCH] Update utils.sh --- scripts/utils.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/utils.sh b/scripts/utils.sh index 38ebdb20..c757c11f 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -122,6 +122,15 @@ stop_spinner() { # Display info message with spinner msg_info() { local msg="$1" + # Close any spinner still running from a previous msg_info that was never + # paired with a msg_ok. Without this its PID is lost when SPINNER_PID is + # overwritten below, leaving an orphan spinner on screen (e.g. behind a + # whiptail dialog). + if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" > /dev/null 2>&1; then + kill "$SPINNER_PID" > /dev/null 2>&1 + wait "$SPINNER_PID" 2>/dev/null + printf "\r\033[K" + fi echo -ne "${TAB}${MG}${HOLD}${msg}" spinner & SPINNER_PID=$!