mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
## Why Repeated alternate-screen entry can overwrite the saved inline viewport, and half-page scrolling can use a different height from the rendered transcript. ## What changed - Make alternate-screen entry idempotent to preserve the inline viewport for restoration. - Defer transcript reflow after raw output mode changes while an overlay is open, preserving queued history until the overlay closes. - Use the last rendered content height for half-page scrolling, matching full-page scrolling. ## Testing Add regression coverage for restoring the inline viewport and draft after closing the transcript with pending history and a raw output mode change, plus half-page scrolling when the rendered height differs from the terminal viewport. GitOrigin-RevId: 30847df4b6383db26791ebda20470c9b169f9680
17 lines
367 B
Rust
17 lines
367 B
Rust
//! Inspect the completed frame without adding test helpers to the terminal implementation.
|
|
|
|
use std::io;
|
|
use std::io::Write;
|
|
|
|
use ratatui::backend::Backend;
|
|
use ratatui::buffer::Buffer;
|
|
|
|
use super::Terminal;
|
|
|
|
pub(crate) fn last_rendered_buffer<B>(terminal: &Terminal<B>) -> &Buffer
|
|
where
|
|
B: Backend<Error = io::Error> + Write,
|
|
{
|
|
terminal.previous_buffer()
|
|
}
|