v.24.5Improvement

Width of Fields Correctly Ignores ANSI Escape Sequences

Width of fields (in Pretty formats or the visibleWidth function) now correctly ignores ANSI escape sequences. #63270 (Shaun Struwig).
The width calculation of fields in Pretty formats and the visibleWidth function now correctly ignores ANSI escape sequences.

Why it matters

This feature solves the issue where ANSI escape sequences were counted as visible characters, causing misalignment in text output formats. By ignoring these sequences, the displayed output aligns properly, improving readability and usability for users leveraging colored or styled text output.

How to use it

Users do not need to enable anything explicitly. When using Pretty formats or the visibleWidth function, the width calculation will automatically ignore ANSI escape sequences, ensuring correct alignment in output.