Fix padding on android

This commit is contained in:
Dylan Araps 2016-08-28 11:41:27 +10:00
parent 5444ecdf6d
commit 76cc33f95f

View file

@ -1974,6 +1974,11 @@ getascii() {
[ "${#line}" -gt "$ascii_length" ] && ascii_length="${#line}" [ "${#line}" -gt "$ascii_length" ] && ascii_length="${#line}"
done <<< "$ascii_strip" done <<< "$ascii_strip"
# Workaround for calculating length of block chars
# when locale is set to 'C'
block_char="█"
[ "${#block_char}" == 3 ] && ascii_length="$((ascii_length / 3 + 2))"
lines="$(printf "%s\n" "$ascii_strip" | wc -l)" lines="$(printf "%s\n" "$ascii_strip" | wc -l)"
padding="\033[$((ascii_length + gap))C" padding="\033[$((ascii_length + gap))C"
printf "%b%s" "$print" printf "%b%s" "$print"