Strip ANSI escape sequences from text.
String stripAnsi(String text) { return text.replaceAll( RegExp(r'\x1B\[[0-9;]*[a-zA-Z]|\x1B\][^\x07]*\x07'), '', ); }