diff --git a/src/event.rs b/src/event.rs index 7d0a970..ee4eedf 100644 --- a/src/event.rs +++ b/src/event.rs @@ -192,10 +192,9 @@ where I: Iterator> let mut buf = Vec::new(); buf.push(c); let mut c = iter.next().unwrap().unwrap(); - while match c { - b'M' | b'~' => false, - _ => true, - } { + // The final byte of a CSI sequence can be in the range 64-126 + // So let's keep reading anything else. + while c < 64 || c > 126 { buf.push(c); c = iter.next().unwrap().unwrap(); }