diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-08-03 22:12:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-03 22:12:23 +0000 |
commit | facab5beef95c4b1808f7bcba92aa74bf792daf0 (patch) | |
tree | 8aac363a7985210ca5956c03c3bc6f9eba7e8f29 | |
parent | 23601fbefcab5ba08884dd87c6a3d2f4347166a2 (diff) | |
download | alacritty-facab5beef95c4b1808f7bcba92aa74bf792daf0.tar.gz alacritty-facab5beef95c4b1808f7bcba92aa74bf792daf0.zip |
Reset visible area when RIS is received
When running bash and executing `echo -ne '\033c'`, the terminal should
be cleared. However there was an issue with the visible area not being
cleared, so all the text previously printed would still remain visible.
To fix this, whenever a `reset` call is received now, the complete
visible area is reset to `Cell::default()` (the default Cell) and the
length of the available scrollback history is reset to `0`, which
results in the scrollback history being cleared from the perspective of
the user.
This fixes #1483.
-rw-r--r-- | src/grid/mod.rs | 2 | ||||
-rw-r--r-- | src/term/mod.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/grid/mod.rs b/src/grid/mod.rs index ef587ffd..05fae373 100644 --- a/src/grid/mod.rs +++ b/src/grid/mod.rs @@ -413,7 +413,7 @@ impl<T> Grid<T> { self.cols } - pub fn reset(&mut self) { + pub fn clear_history(&mut self) { self.scroll_limit = 0; } diff --git a/src/term/mod.rs b/src/term/mod.rs index 2cc60e30..1b78c39c 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -1825,7 +1825,8 @@ impl ansi::Handler for Term { self.colors = self.original_colors; self.color_modified = [false; color::COUNT]; self.cursor_style = None; - self.grid.reset(); + self.grid.clear_history(); + self.grid.region_mut(..).each(|c| c.reset(&Cell::default())); } #[inline] |