-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
Hey folks!
According to the README.md, control characters should be treated as zero width, but it seems like ANSI color sequences are not currently. Code like the following (using strip_ansi_escapes) will fail for strings containing ANSI control characters:
fn assert_width(s: String) {
let stripped_width = std::str::from_utf8(&strip_ansi_escapes::strip(s.as_bytes()).unwrap())
.unwrap()
.width() as u16;
let unicode_width = s.width() as u16;
assert_eq!(
stripped_width, unicode_width,
"Mismatched width ({} vs {}) for `{:?}`",
stripped_width, unicode_width, s
);
}...such as:
"\u{1b}[1m========\u{1b}[0m"Is this expected?
Metadata
Metadata
Assignees
Labels
No labels