1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2025-04-21 18:02:37 -04:00

Fix the crash when shrinking scrolled terminal

display_offset was adjusted unconditionally, thus it could go
beyound the history limits, so clamp it to history like we do
in grow_colums.

Fixes #6862.
This commit is contained in:
Kirill Chibisov 2023-06-17 21:55:12 +00:00
parent b08dd9ded3
commit 5999fc72f8
2 changed files with 4 additions and 0 deletions

View file

@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Hyperlink preview not being shown when the terminal has exactly 2 lines
- Crash on Windows when changing display scale factor
- Freeze with some drivers when using GLX
- Crash when shrinking the terminal scrolled into the history
## 0.12.1

View file

@ -368,6 +368,9 @@ impl<T: GridCell + Default + PartialEq + Clone> Grid<T> {
reversed.truncate(self.max_scroll_limit + self.lines);
self.raw.replace_inner(reversed);
// Clamp display offset in case some lines went off.
self.display_offset = min(self.display_offset, self.history_size());
// Reflow the primary cursor, or clamp it if reflow is disabled.
if !reflow {
self.cursor.point.column = min(self.cursor.point.column, Column(columns - 1));