@@ -367,10 +367,9 @@ impl<'a> Printer for InteractivePrinter<'a> {
367367 match chunk {
368368 // ANSI escape passthrough.
369369 (text, true) => {
370− let is_ansi_csi =
371− text.chars().skip(1).nth(0).map_or(false, |c| c == '[');
370+ let is_ansi_csi = text.starts_with("\x1B[");
372371
373− if is_ansi_csi && text.chars().last().map_or(false, |c| c == 'm') {
372+ if is_ansi_csi && text.ends_with('m') {
374373 // It's an ANSI SGR sequence.
375374 // We should be mostly safe to just append these together.
376375 ansi_prefix.push_str(text);