mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 09:46:44 +00:00
fix: use \033[2K to fully clear spinner lines and prevent text remnants
Fixes text remnants showing when spinner messages change from longer to shorter text. Changed from \033[K (clear to end of line) to \033[2K (clear entire line) in stop_section_spinner(), safe_clear_line(), and safe_clear_lines() functions. Fixes #390
This commit is contained in:
@@ -628,7 +628,7 @@ start_section_spinner() {
|
||||
stop_section_spinner() {
|
||||
stop_inline_spinner 2> /dev/null || true
|
||||
if [[ -t 1 ]]; then
|
||||
echo -ne "\r\033[K" >&2 || true
|
||||
echo -ne "\r\033[2K" >&2 || true
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ safe_clear_lines() {
|
||||
# Clear lines one by one (more reliable than multi-line sequences)
|
||||
local i
|
||||
for ((i = 0; i < lines; i++)); do
|
||||
printf "\033[1A\r\033[K" > "$tty_device" 2> /dev/null || return 1
|
||||
printf "\033[1A\r\033[2K" > "$tty_device" 2> /dev/null || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
@@ -660,7 +660,7 @@ safe_clear_line() {
|
||||
# Use centralized ANSI support check
|
||||
is_ansi_supported 2> /dev/null || return 1
|
||||
|
||||
printf "\r\033[K" > "$tty_device" 2> /dev/null || return 1
|
||||
printf "\r\033[2K" > "$tty_device" 2> /dev/null || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user