Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions kaku-gui/src/termwindow/resize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,12 @@ impl super::TermWindow {
tab.resize(size);
}
}
for tab in window.iter() {
for pos in tab.iter_panes_ignoring_zoom() {
let mut state = self.pane_state(pos.pane.pane_id());
state.viewport = None;
}
}
};
if live {
self.pending_pty_flush_after_resize = true;
Expand Down
8 changes: 8 additions & 0 deletions term/src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,18 @@ impl Screen {
// pre-prune blank lines that range from the cursor position to the end of the display;
// this avoids growing the scrollback size when rapidly switching between normal and
// maximized states.
// Limit pruning to lines beyond the visible viewport to avoid losing
// scrollback content during repeated resizes.
let cursor_phys = self.phys_row(cursor.y);
let max_prune = self.lines.len().saturating_sub(self.physical_rows);
let mut pruned = 0;
for _ in cursor_phys + 1..self.lines.len() {
if pruned >= max_prune {
break;
}
if self.lines.back().map(Line::is_whitespace).unwrap_or(false) {
self.lines.pop_back();
pruned += 1;
}
}

Expand Down