displayWidth property

int get displayWidth

The number of displayed character cells that are represented by the string.

This should never be more than the length of the string; it excludes ANSI control characters.

Implementation

int get displayWidth => stripEscapeCharacters().length;