Skip to main content

width_ansi_str

Function width_ansi_str 

Source
pub fn width_ansi_str(input: &str) -> usize
Expand description

Visible terminal width of a UTF-8 string, ignoring ANSI/VT escape sequences.

Escape sequences form grapheme-cluster boundaries. C1 introducers are recognized, and an unterminated sequence makes the remainder contribute zero width.