fix(compatibilty): do not use current cursor style in csi erase display (#1142)

This commit is contained in:
Thomas Linford 2022-02-27 21:15:03 +01:00 committed by GitHub
parent 611ceb0309
commit efd2fa412f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1686,16 +1686,14 @@ impl Perform for Grid {
};
} else if c == 'J' {
// clear all (0 => below, 1 => above, 2 => all, 3 => saved)
let mut char_to_replace = EMPTY_TERMINAL_CHARACTER;
char_to_replace.styles = self.cursor.pending_styles;
if let Some(clear_type) = params_iter.next().map(|param| param[0]) {
if clear_type == 0 {
self.clear_all_after_cursor(char_to_replace);
self.clear_all_after_cursor(EMPTY_TERMINAL_CHARACTER);
} else if clear_type == 1 {
self.clear_all_before_cursor(char_to_replace);
self.clear_all_before_cursor(EMPTY_TERMINAL_CHARACTER);
} else if clear_type == 2 {
self.fill_viewport(char_to_replace);
self.fill_viewport(EMPTY_TERMINAL_CHARACTER);
} else if clear_type == 3 {
self.clear_lines_above();
}