You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Err(_) => returnErr(io::Error::new(io::ErrorKind::Other,format!("invalid terminal response: middle part of the output {:?} must be valid UTF-8", buf))),
61
61
};
62
-
let(nstr, mstr) = match middle.split_once(';'){
63
-
Some((nstr, mstr)) => (nstr, mstr),
64
-
None => returnErr(io::Error::new(io::ErrorKind::Other,format!("invalid terminal response: middle part of the output should be of the form n;m, got {}", middle))),
62
+
let parts = middle.splitn(2,';').collect::<Vec<_>>();
63
+
let(nstr, mstr) =
64
+
match&parts[..]{
65
+
[a, b] => (a, b),
66
+
_ => returnErr(io::Error::new(io::ErrorKind::Other,format!("invalid terminal response: middle part of the output should be of the form n;m, got {}", middle))),
65
67
};
66
68
let(n, m) = (nstr.parse::<u16>().unwrap(), mstr.parse::<u16>().unwrap());
67
69
Ok((n, m))
68
-
},
69
-
_ => returnErr(io::Error::new(io::ErrorKind::Other,"invalid terminal response: should be of the form ESC[n;mR")),
70
+
}
71
+
_ => Err(io::Error::new(
72
+
io::ErrorKind::Other,
73
+
"invalid terminal response: should be of the form ESC[n;mR",
0 commit comments