pub fn truncate_to_width(s: &str, max_cols: usize) -> String
Truncate s so its display width is at most max_cols. Guaranteed to return a valid UTF-8 string that never splits a grapheme.
s
max_cols