From 44037fa42aa80002ce54f0a8e4a6203e3e12aaf5 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Sun, 22 Dec 2019 14:05:19 +0300 Subject: [PATCH] Fix crash on clear when scrolled up in history Fixes #3112. --- CHANGELOG.md | 1 + alacritty_terminal/src/grid/mod.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8bd9a2..a7e6ddb 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 ad9d9b7..a12c950 100644 --- a/alacritty_terminal/src/grid/mod.rs +++ b/alacritty_terminal/src/grid/mod.rs @@ -544,6 +544,9 @@ impl Grid { 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(®ion, positions, template);