Fix CI errors

This commit is contained in:
Javier Soto
2025-09-02 16:34:59 -07:00
parent 8ac87edd64
commit 557731d7d6

View File

@@ -201,16 +201,14 @@ where
/// Creates a new [`Terminal`] with the given [`Backend`] and [`TerminalOptions`].
pub fn with_options(mut backend: B) -> io::Result<Self> {
let screen_size = backend.size()?;
let cursor_pos = backend
.get_cursor_position()
.or_else(|error| {
if is_get_cursor_position_timeout_error(&error) {
tracing::warn!("cursor position read timed out during startup: {error}");
Ok(Position { x: 0, y: 0 })
} else {
Err(error)
}
})?;
let cursor_pos = backend.get_cursor_position().or_else(|error| {
if is_get_cursor_position_timeout_error(&error) {
tracing::warn!("cursor position read timed out during startup: {error}");
Ok(Position { x: 0, y: 0 })
} else {
Err(error)
}
})?;
Ok(Self {
backend,
buffers: [
@@ -418,9 +416,8 @@ where
pub fn get_cursor_position(&mut self) -> io::Result<Position> {
self.backend
.get_cursor_position()
.map(|position| {
self.last_known_cursor_pos = position;
position
.inspect(|position| {
self.last_known_cursor_pos = *position;
})
.or_else(|error| {
if is_get_cursor_position_timeout_error(&error) {