Teach codex to test itself (#11531)

For fun and profit!
This commit is contained in:
pakrym-oai
2026-02-11 20:03:19 -08:00
committed by GitHub
parent d1a97ed852
commit b8e0d7594f
2 changed files with 20 additions and 1 deletions

View File

@@ -147,7 +147,12 @@ 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()?;
let cursor_pos = backend.get_cursor_position().unwrap_or_else(|err| {
// Some PTYs do not answer CPR (`ESC[6n`); continue with a safe default instead
// of failing TUI startup.
tracing::warn!("failed to read initial cursor position; defaulting to origin: {err}");
Position { x: 0, y: 0 }
});
Ok(Self {
backend,
buffers: [Buffer::empty(Rect::ZERO), Buffer::empty(Rect::ZERO)],