Calculate text height based on newline count.
SourceStrip ANSI escape codes from text.
Handles common CSI/OSC sequences and Bubblezone markers (CSI ... z).
SourceTruncate text to width, respecting ANSI codes.
SourceCalculate the display width of text (ignoring ANSI codes)
Source