From fb8e44b8a8454887e61b8a331fbd7ea4a0a817c5 Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Tue, 28 Sep 2021 16:44:26 +0200 Subject: [PATCH] fix(compatibility): scroll lines into scrollback when clearing screen (#747) * fix(compatibility): scroll lines into scrollback when clearing screen * fix(tests): silently fail on channel close error --- src/tests/e2e/remote_runner.rs | 2 +- zellij-server/src/panes/grid.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tests/e2e/remote_runner.rs b/src/tests/e2e/remote_runner.rs index 924babf68..b2d517c44 100644 --- a/src/tests/e2e/remote_runner.rs +++ b/src/tests/e2e/remote_runner.rs @@ -496,6 +496,6 @@ impl RemoteRunner { impl Drop for RemoteRunner { fn drop(&mut self) { - self.channel.close().unwrap(); + let _ = self.channel.close(); } } diff --git a/zellij-server/src/panes/grid.rs b/zellij-server/src/panes/grid.rs index f157b3274..1cbd73dea 100644 --- a/zellij-server/src/panes/grid.rs +++ b/zellij-server/src/panes/grid.rs @@ -843,7 +843,13 @@ impl Grid { } } pub fn fill_viewport(&mut self, character: TerminalCharacter) { - self.viewport.clear(); + let row_count_to_transfer = self.viewport.len(); + transfer_rows_from_viewport_to_lines_above( + &mut self.viewport, + &mut self.lines_above, + row_count_to_transfer, + self.width, + ); for _ in 0..self.height { let columns = vec![character; self.width]; self.viewport.push(Row::from_columns(columns).canonical());