bin:no-ansi-sgr: Conform to specification
Previously - in the existence of other ANSI escape sequences - the
script deleted text due to the too broad regex. For example in:
foo^[[K bar m
everything behind `foo` was deleted. Thus, only remove SGR sequences by
only matching the spec-allowed bytes.
This commit is contained in:
@@ -5,4 +5,5 @@
|
|||||||
# Remove ANSI SGR (Select Graphic Rendition) escape sequences, e.g. setting
|
# Remove ANSI SGR (Select Graphic Rendition) escape sequences, e.g. setting
|
||||||
# color or bold font.
|
# color or bold font.
|
||||||
|
|
||||||
s/\[[^m]*m//g
|
# TODO: Why is the range `[0-?]` invalid?
|
||||||
|
s/\[[0-9:-?]*[ -/]*m//g
|
||||||
|
|||||||
Reference in New Issue
Block a user