From 18a226fe4562a9c80800a3adc23d77f452d1a635 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 19 Nov 2020 01:15:34 +0000 Subject: [PATCH] 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. --- CHANGELOG.md | 1 + alacritty_terminal/src/term/mod.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 526f611b..741702ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 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]