Fixed SC2001 error, you also need to use \033 instead of pasting the character in.

This commit is contained in:
Syphist 2020-08-25 04:40:42 -05:00
parent 0e7799ff7e
commit 4141531b22

View file

@ -39,7 +39,7 @@ sys_locale=${LANG:-C}
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-${HOME}/.config}
PATH=$PATH:/usr/xpg4/bin:/usr/sbin:/sbin:/usr/etc:/usr/libexec
reset='\e[0m'
shopt -s nocasematch
shopt -s nocasematch extglob
# Speed up script by not using unicode.
LC_ALL=C
@ -3879,7 +3879,8 @@ print_ascii() {
line=${line//\\\\/\\}
line=${line//█/ }
# Use Regex through sed to remove color and formatting codes
line=$(echo "$line" | sed 's/\x1B\[[0-9;]*[JKmsu]//g')
search='\\033\[*([0-9;])[JKmsu]'
line=${line//$search/}
((++lines,${#line}>ascii_len)) && ascii_len="${#line}"
done <<< "${ascii_data//\$\{??\}}"