Avoid querying terminal size on every TUI redraw (#36482)

## What changed

- Carry dimensions on resize events and reuse the cached screen size for ordinary draws.
- Refresh terminal geometry after resize settling, process resume, and external program execution.
- Pass the resolved size through transcript reflow, viewport updates, and standalone TUI screens so each frame uses consistent dimensions.

## Testing

- Cover cached draws, resize-driven rendering, settled-size rechecks, resume refreshes, and alternate-screen size updates.

GitOrigin-RevId: 9d83dbab50d7a038bd59b4c66c13abcac69ddc79
This commit is contained in:
Felipe Coury authored and copyberry committed 2026-08-01 14:33:12 +00:00
1 parent ee0247f95a
commit 7dc1856685
21 files changed
+398 -97

No files matched your search

+2 -1
View File
@@ -79,7 +79,8 @@ impl App {
} else {
self.chat_widget.set_raw_output_mode(enabled);
}
if let Err(err) = self.reflow_transcript_now(tui) {
let terminal_width = tui.terminal.last_known_screen_size.into();
if let Err(err) = self.reflow_transcript_now(tui, terminal_width) {
tracing::warn!(error = %err, "failed to reflow transcript after raw output mode toggle");
self.chat_widget
.add_error_message(format!("Failed to redraw transcript: {err}"));