mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
Fix CI errors
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user