From 4d72c1f5f9b1e95189231cf778b754f2e52ac313 Mon Sep 17 00:00:00 2001 From: Felipe Coury Date: Sun, 28 Jun 2026 17:03:30 -0300 Subject: [PATCH] fix(tui): preserve transcript on viewport growth --- codex-rs/tui/src/tui.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/codex-rs/tui/src/tui.rs b/codex-rs/tui/src/tui.rs index 7bf72f7cdf..8f1fa76900 100644 --- a/codex-rs/tui/src/tui.rs +++ b/codex-rs/tui/src/tui.rs @@ -912,11 +912,10 @@ impl Tui { let mut area = terminal.viewport_area; area.height = height.min(size.height); area.width = size.width; - // If the viewport has expanded, scroll everything else up to make room. + // Keep the viewport bottom-aligned as it grows. The next frame + // redraws the expanded viewport, so scrolling rows above it here + // would permanently discard visible transcript lines. if area.bottom() > size.height { - terminal - .backend_mut() - .scroll_region_up(0..area.top(), area.bottom() - size.height)?; area.y = size.height - area.height; } if area != terminal.viewport_area {