From 4141531b229829e23f843d6a90469061660c1e68 Mon Sep 17 00:00:00 2001 From: Syphist Date: Tue, 25 Aug 2020 04:40:42 -0500 Subject: [PATCH] Fixed SC2001 error, you also need to use \033 instead of pasting the character in. --- neofetch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 985e6baf..efce4681 100755 --- a/neofetch +++ b/neofetch @@ -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//\$\{??\}}"