cutAnsiByCells function
Cuts an ANSI string by visible cell indices, preserving any active SGR/OSC 8 state at the start boundary.
This is useful for viewport-style horizontal scrolling and truncation.
Implementation
String cutAnsiByCells(String s, int start, int end) =>
_cutAnsiByCells(s, start, end);