summaryrefslogtreecommitdiffstats
path: root/alacritty_terminal
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-11-19 01:15:34 +0000
committerGitHub <noreply@github.com>2020-11-19 01:15:34 +0000
commit18a226fe4562a9c80800a3adc23d77f452d1a635 (patch)
tree4f3d97f40fc36142392d03b64fb8a2cbddb144cd /alacritty_terminal
parent9724418d350df881afe8453bde6eb88643e7211e (diff)
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.
Diffstat (limited to 'alacritty_terminal')
-rw-r--r--alacritty_terminal/src/term/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs
index fa2c5513..926b89d7 100644
--- a/alacritty_terminal/src/term/mod.rs
+++ b/alacritty_terminal/src/term/mod.rs
@@ -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]