From 18a226fe4562a9c80800a3adc23d77f452d1a635 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 19 Nov 2020 01:15:34 +0000 Subject: 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. --- alacritty_terminal/src/term/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'alacritty_terminal/src') 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 Handler for Term { 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 Handler for Term { 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] -- cgit v1.2.3-54-g00ecf