summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <wchibisovkirill@gmail.com>2019-12-22 14:05:19 +0300
committerChristian Duerr <contact@christianduerr.com>2019-12-22 11:05:19 +0000
commit44037fa42aa80002ce54f0a8e4a6203e3e12aaf5 (patch)
tree8bb3d2aa248224c4f1fe29334750a421ee193473
parent85112fefa56cfc125df46b171f154ad44e4e6c3a (diff)
downloadalacritty-44037fa42aa80002ce54f0a8e4a6203e3e12aaf5.tar.gz
alacritty-44037fa42aa80002ce54f0a8e4a6203e3e12aaf5.zip
Fix crash on clear when scrolled up in history
Fixes #3112.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty_terminal/src/grid/mod.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a8bd9a2d..a7e6ddb7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Performance bottleneck when clearing colored rows
- Vague startup crash messages on Windows with WinPTY backend
- Deadlock on Windows when closing Alacritty using the title bar "X" button (ConPTY backend)
+- Crash on `clear` when scrolled up in history
## 0.4.0
diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs
index ad9d9b7b..a12c9509 100644
--- a/alacritty_terminal/src/grid/mod.rs
+++ b/alacritty_terminal/src/grid/mod.rs
@@ -544,6 +544,9 @@ impl<T: GridCell + PartialEq + Copy> Grid<T> {
let positions = self.lines - iter.cur.line;
let region = Line(0)..self.num_lines();
+ // Reset display offset
+ self.display_offset = 0;
+
// Clear the viewport
self.scroll_up(&region, positions, template);