Skip to content

Commit

Permalink
[PR] #161 from Proximyst/mariellh/improve-colour-removal
Browse files Browse the repository at this point in the history
perf: use sed for colour removals
  • Loading branch information
hykilpikonna authored Aug 6, 2023
2 parents 1bf2281 + cf17522 commit 0305e26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -5152,7 +5152,7 @@ print_ascii() {
strip_escape_codes "${line}" line
# Use patterns to replace color codes that the above line did not catch
line=${line//\\033\[*([0-9;])[JKmsu]/}
line=${line//\[*([0-9;])[JKmsu]/}
line="$(printf %b "$line" | sed -E 's/'"$(printf %b '\x1B')"'\[*[0-9;]+[JKmsu]//g')"
((++lines,${#line}>ascii_len)) && ascii_len="${#line}"
done <<< "${ascii_data//\$\{??\}}"
fi
Expand Down

0 comments on commit 0305e26

Please sign in to comment.