Get position bug fixed (#465)
This commit is contained in:
parent
30b7d99364
commit
6326795700
@ -1,3 +1,6 @@
|
|||||||
|
# Version 0.17.7
|
||||||
|
- Fix cursor position retrieval bug linux.
|
||||||
|
|
||||||
# Version 0.17.6
|
# Version 0.17.6
|
||||||
- Add functionality to retrieve color based on passed ansi code.
|
- Add functionality to retrieve color based on passed ansi code.
|
||||||
- Switch from 'futures' to 'futures-util' crate to reduce dependency count
|
- Switch from 'futures' to 'futures-util' crate to reduce dependency count
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "crossterm"
|
name = "crossterm"
|
||||||
version = "0.17.6"
|
version = "0.17.7"
|
||||||
authors = ["T. Post"]
|
authors = ["T. Post"]
|
||||||
description = "An crossplatform terminal library for manipulating terminals."
|
description = "An crossplatform terminal library for manipulating terminals."
|
||||||
repository = "https://github.com/crossterm-rs/crossterm"
|
repository = "https://github.com/crossterm-rs/crossterm"
|
||||||
|
@ -79,7 +79,16 @@ impl EventSource for UnixInternalEventSource {
|
|||||||
let timeout = PollTimeout::new(timeout);
|
let timeout = PollTimeout::new(timeout);
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
self.poll.poll(&mut self.events, timeout.leftover())?;
|
if let Err(e) = self.poll.poll(&mut self.events, timeout.leftover()) {
|
||||||
|
// Mio will throw an interrupted error in case of cursor position retrieval. We need to retry until it succeeds.
|
||||||
|
// Previous versions of Mio (< 0.7) would automatically retry the poll call if it was interrupted (if EINTR was returned).
|
||||||
|
// https://docs.rs/mio/0.7.0/mio/struct.Poll.html#notes
|
||||||
|
if e.kind() == io::ErrorKind::Interrupted {
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
return Err(ErrorKind::IoError(e));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if self.events.is_empty() {
|
if self.events.is_empty() {
|
||||||
// No readiness events = timeout
|
// No readiness events = timeout
|
||||||
|
Loading…
Reference in New Issue
Block a user