diff options
author | Christian Duerr <contact@christianduerr.com> | 2022-03-10 20:45:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 22:45:20 +0300 |
commit | 0965773657b9d3cc6917cf980110509dcc82426f (patch) | |
tree | 47adfffeefb1baef8b0527b206460b3c1e132ce5 /alacritty_terminal | |
parent | a69c3c408f6e00af9900ab28861af78e38ff1cf4 (diff) | |
download | alacritty-0965773657b9d3cc6917cf980110509dcc82426f.tar.gz alacritty-0965773657b9d3cc6917cf980110509dcc82426f.zip |
Fix crash when searching during reset
This fixes a crash which occurs when the terminal is reset while
searching, due to the vi mode cursor being outside of the visible area.
This also fixes an issue where the search state reset would incorrectly
clamp the vi mode cursor to the grid, rather than the absolute viewport
position.
While this fix does resolve all crashes when searching while running
`cat /dev/urandom`, it does raise the question if manually clamping the
vi mode cursor in every location where it is modified is the right
choice.
A follow-up to provide a safer API which guarantees correct modification
of the vi mode cursor location is probably a good idea.
Fixes #5942.
Diffstat (limited to 'alacritty_terminal')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 5ad1b4ad..96f0d1e7 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1795,6 +1795,7 @@ impl<T: EventListener> Handler for Term<T> { self.title_stack = Vec::new(); self.title = None; self.selection = None; + self.vi_mode_cursor = Default::default(); // Preserve vi mode across resets. self.mode &= TermMode::VI; |