diff options
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r-- | cmd2/utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py index 909332ae..a09e8785 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -22,9 +22,10 @@ def strip_ansi(text: str) -> str: return constants.ANSI_ESCAPE_RE.sub('', text) -def display_width(text: str) -> int: +def ansi_safe_wcswidth(text: str) -> int: """ - Return the printable length of a string. This can be different than character count in unicode strings. + Wraps wcswidth to make it compatible with colored strings + :param text: the string being measured """ # Strip ANSI escape codes since they cause wcswidth to return -1 |