pub fn width(text: &str) -> usize
The display width of text in terminal columns, ignoring escape sequences and control characters and counting wide characters as two.
text