Skip to main content

visible_width

Function visible_width 

Source
pub fn visible_width(s: &str) -> usize
Expand description

Compute the visible display width of a string.

ANSI escape sequences (CSI \x1b[… and OSC \x1b]…) do not contribute to the width. Full-width characters (e.g. CJK) count as 2 columns.