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();
|
let mut buf = Vec::new();
|
||||||
buf.push(c);
|
buf.push(c);
|
||||||
let mut c = iter.next().unwrap().unwrap();
|
let mut c = iter.next().unwrap().unwrap();
|
||||||
while match c {
|
// The final byte of a CSI sequence can be in the range 64-126
|
||||||
b'M' | b'~' => false,
|
// So let's keep reading anything else.
|
||||||
_ => true,
|
while c < 64 || c > 126 {
|
||||||
} {
|
|
||||||
buf.push(c);
|
buf.push(c);
|
||||||
c = iter.next().unwrap().unwrap();
|
c = iter.next().unwrap().unwrap();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue