Fix vi mode terminal reset

Since the vi mode is unrelated to the terminal emulation itself, it
should not be reset during a `reset` to prevent unnecessary confusion.

This also prevents the search from switching from vi mode to vi-less
search without any indication to the user.
This commit is contained in:
Christian Duerr 2020-11-19 01:15:34 +00:00 committed by GitHub
parent 9724418d35
commit 18a226fe45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Wide characters sometimes being cut off
- Preserve vi mode across terminal `reset`
## 0.6.0

View File

@ -2083,7 +2083,6 @@ impl<T: EventListener> Handler for Term<T> {
mem::swap(&mut self.grid, &mut self.inactive_grid);
}
self.active_charset = Default::default();
self.mode = Default::default();
self.colors = self.original_colors;
self.color_modified = [false; color::COUNT];
self.cursor_style = None;
@ -2095,6 +2094,10 @@ impl<T: EventListener> Handler for Term<T> {
self.title = None;
self.selection = None;
self.regex_search = None;
// Preserve vi mode across resets.
self.mode &= TermMode::VI;
self.mode.insert(TermMode::default());
}
#[inline]