pub fn sanitize_text(text: &str) -> String
Remove ANSI escapes and control characters from untrusted text so rendering it cannot alter terminal state. Line breaks and tabs collapse to single spaces.