Fix CSI sequence detection (#69)
Properly detects CSI sequence termination. Fixes #47, #68.
This commit is contained in:
parent
f49a6e501b
commit
786001f095
|
@ -192,10 +192,9 @@ where I: Iterator<Item = Result<u8, Error>>
|
|||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue