Update core.func

This commit is contained in:
CanbiZ 2025-05-15 11:29:06 +02:00
parent 79533c055b
commit c7ba6705aa

View File

@ -239,7 +239,7 @@ start_spinner() {
SPINNER_MSG="$msg" SPINNER_MSG="$msg"
SPINNER_ACTIVE=1 SPINNER_ACTIVE=1
{ _spinner_loop() {
while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do
if [[ -t 2 ]]; then if [[ -t 2 ]]; then
printf "\r\e[2K%s %b" "${TAB}${spinner_frames[spin_i]}${TAB}" "${YW}${SPINNER_MSG}${CL}" >&2 printf "\r\e[2K%s %b" "${TAB}${spinner_frames[spin_i]}${TAB}" "${YW}${SPINNER_MSG}${CL}" >&2
@ -250,15 +250,10 @@ start_spinner() {
spin_i=$(((spin_i + 1) % ${#spinner_frames[@]})) spin_i=$(((spin_i + 1) % ${#spinner_frames[@]}))
sleep "$interval" sleep "$interval"
done done
} & }
local pid=$! _spinner_loop &
if kill -0 "$pid" 2>/dev/null; then SPINNER_PID=$!
SPINNER_PID="$pid"
else
SPINNER_ACTIVE=0
SPINNER_PID=""
fi
} }
# === Spinner Stop === # === Spinner Stop ===