Strips ANSI escape sequences and control characters to prevent UI spoofing.
String sanitizeTerminalText(Object? text) { return text.toString().replaceAll(_ansiCsi, '').replaceAll(_controlChars, ''); }