Using regex I was able to strip color codes from ascii art line length calculations.
This commit is contained in:
parent
bfbefc7f6b
commit
0e7799ff7e
1 changed files with 2 additions and 0 deletions
2
neofetch
2
neofetch
|
@ -3878,6 +3878,8 @@ print_ascii() {
|
|||
while IFS=$'\n' read -r line; do
|
||||
line=${line//\\\\/\\}
|
||||
line=${line//█/ }
|
||||
# Use Regex through sed to remove color and formatting codes
|
||||
line=$(echo "$line" | sed 's/\x1B\[[0-9;]*[JKmsu]//g')
|
||||
((++lines,${#line}>ascii_len)) && ascii_len="${#line}"
|
||||
done <<< "${ascii_data//\$\{??\}}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue