Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

tui: fix extra blank lines in streamed agent messages (#3065)

Jeremy Rose46e35a2345ce
diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs
index de548337b1..5a74b4582c 100644
--- a/codex-rs/tui/src/app.rs
+++ b/codex-rs/tui/src/app.rs
@@ -191,10 +191,15 @@ impl App {
self.transcript_lines.extend(cell_transcript.clone());
let mut display = cell.display_lines(tui.terminal.last_known_screen_size.width);
if !display.is_empty() {
- if self.has_emitted_history_lines {
- display.insert(0, Line::from(""));
- } else {
- self.has_emitted_history_lines = true;
+ // Only insert a separating blank line for new cells that are not
+ // part of an ongoing stream. Streaming continuations should not
+ // accrue extra blank lines between chunks.
+ if !cell.is_stream_continuation() {
+ if self.has_emitted_history_lines {
+ display.insert(0, Line::from(""));
+ } else {
+ self.has_emitted_history_lines = true;
+ }
}
if self.overlay.is_some() {
self.deferred_history_lines.extend(display);