ASCII-only spinner frames and output (VM locale rendered braille as garbage)
The braille spinner frames and the em-dash separator are multibyte UTF-8; on the VM session they rendered as changing random letters, not a spinner. Frames are now the classic | / - \ cycle, the separator is ':', and the two user-facing info lines that carried em-dashes are ASCII too. Verified under LANG=C LC_ALL=C in a pty: zero non-ASCII bytes in the entire output.
This commit is contained in:
+5
-2
@@ -107,14 +107,17 @@ ui_quiet_run() {
|
||||
# animates independently of gum and shows real progress, not just motion.
|
||||
"$@" >>"$log" 2>&1 &
|
||||
local pid=$!
|
||||
local frames=( '⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏' )
|
||||
# ASCII frames ONLY: braille/em-dash are multibyte UTF-8 and rendered as
|
||||
# garbage letters when the session locale is not UTF-8 (VM-proven: the
|
||||
# spinner appeared as changing random chars, not as a spinner).
|
||||
local frames=( '|' '/' '-' '\\' )
|
||||
local f=0 cur
|
||||
while kill -0 "$pid" 2>/dev/null; do
|
||||
cur=$(sed -n "$((before+1)),\$p" "$log" 2>/dev/null \
|
||||
| grep -E '^(Installing|Upgrading|Downgrading|Removing|Verifying|Preparing|Cleanup):' \
|
||||
| tail -n 1 || true)
|
||||
if [[ -n "$cur" ]]; then
|
||||
printf '\r %s %s — %s' "${frames[$f]}" "$msg" "$cur" >&2
|
||||
printf '\r %s %s: %s' "${frames[$f]}" "$msg" "$cur" >&2
|
||||
else
|
||||
printf '\r %s %s' "${frames[$f]}" "$msg" >&2
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user