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
This commit is contained in:
Aram Drevekenin 2021-09-28 16:44:26 +02:00 committed by GitHub
parent 865209c18b
commit fb8e44b8a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -496,6 +496,6 @@ impl RemoteRunner {
impl Drop for RemoteRunner {
fn drop(&mut self) {
self.channel.close().unwrap();
let _ = self.channel.close();
}
}

View File

@ -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());