mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-03 04:34:21 -05:00
Fix bug with restore cursor
The saved cursor position could previously end up outside of the grid if the terminal was resized to be smaller and then calling a restore. Restore now ensures the cursor line and column are within grid bounds.
This commit is contained in:
parent
8f2e7b08a6
commit
82c9235bb1
1 changed files with 2 additions and 0 deletions
|
@ -1086,6 +1086,8 @@ impl ansi::Handler for Term {
|
|||
};
|
||||
|
||||
self.cursor = *holder;
|
||||
self.cursor.point.line = min(self.cursor.point.line, self.grid.num_lines() - 1);
|
||||
self.cursor.point.col = min(self.cursor.point.col, self.grid.num_cols() - 1);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Reference in a new issue