add support for xterm mouse release code (#97)

Codes of the form `ESC [ < 3 ; Cx ; Cy` were not supported before.
This commit is contained in:
IGI-111 2017-03-24 21:48:55 +01:00 committed by ticki
parent 11a0ee178a
commit 5e336e10a1
1 changed files with 2 additions and 1 deletions

View File

@ -182,7 +182,7 @@ fn parse_csi<I>(iter: &mut I) -> Option<Event>
}
Some(Ok(b'<')) => {
// xterm mouse encoding:
// ESC [ < Cb ; Cx ; Cy ; (M or m)
// ESC [ < Cb ; Cx ; Cy (;) (M or m)
let mut buf = Vec::new();
let mut c = iter.next().unwrap().unwrap();
while match c {
@ -216,6 +216,7 @@ fn parse_csi<I>(iter: &mut I) -> Option<Event>
}
}
32 => MouseEvent::Hold(cx, cy),
3 => MouseEvent::Release(cx, cy),
_ => return None,
};