From e7ea05f50bcb19342639ce231638f71eca768f70 Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Tue, 19 Jan 2021 18:34:53 +0100 Subject: [PATCH] fix(compatibility): don't drop empty lines when resizing (#148) --- src/panes/grid.rs | 5 ++++- src/panes/terminal_pane.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/panes/grid.rs b/src/panes/grid.rs index 3d0f220b76..754433d250 100644 --- a/src/panes/grid.rs +++ b/src/panes/grid.rs @@ -272,6 +272,9 @@ impl Grid { let mut new_viewport_rows = vec![]; for mut canonical_line in viewport_canonical_lines { let mut canonical_line_parts: Vec = vec![]; + if canonical_line.columns.is_empty() { + canonical_line_parts.push(Row::new().canonical()); + } while !canonical_line.columns.is_empty() { let next_wrap = if canonical_line.len() > new_columns { canonical_line.columns.drain(..new_columns) @@ -279,7 +282,7 @@ impl Grid { canonical_line.columns.drain(..) }; let row = Row::from_columns(next_wrap.collect()); - // if there are no more parts, this row is canonical as long as it originall + // if there are no more parts, this row is canonical as long as it originally // was canonical (it might not have been for example if it's the first row in // the viewport, and the actual canonical row is above it in the scrollback) let row = if canonical_line_parts.is_empty() && canonical_line.is_canonical { diff --git a/src/panes/terminal_pane.rs b/src/panes/terminal_pane.rs index 3ad6005070..466f5b6553 100644 --- a/src/panes/terminal_pane.rs +++ b/src/panes/terminal_pane.rs @@ -496,6 +496,7 @@ impl vte::Perform for TerminalPane { std::mem::swap(&mut self.grid, alternative_grid); } self.alternative_grid = None; + self.mark_for_rerender(); } Some(&25) => { self.grid.hide_cursor();