diff options
author | Andrew Lee <32912555+candrewlee14@users.noreply.github.com> | 2024-02-12 01:24:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 08:24:24 +0000 |
commit | f96cb6903db04339bf029e1c1cd2c5b27d210e19 (patch) | |
tree | 4a75789161250b791a8baddab866b8e2e3448202 | |
parent | 5738d0628238e9a3fd24e191e28f2e4223b0457e (diff) |
fix: reorder the exit of enhanced keyboard mode (#1694)
The `Stdout::new` function first enters an alternate
screen then later enables enhanced keyboard mode.
In `Drop`, we need to do this in the opposite order:
disable enhanced keyboard mode then exit alternate mode.
Fixes #1693
-rw-r--r-- | atuin/src/command/client/search/interactive.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/atuin/src/command/client/search/interactive.rs b/atuin/src/command/client/search/interactive.rs index 1a94e36d..5401a269 100644 --- a/atuin/src/command/client/search/interactive.rs +++ b/atuin/src/command/client/search/interactive.rs @@ -794,6 +794,9 @@ impl Stdout { impl Drop for Stdout { fn drop(&mut self) { + #[cfg(not(target_os = "windows"))] + execute!(self.stdout, PopKeyboardEnhancementFlags).unwrap(); + if !self.inline_mode { execute!(self.stdout, terminal::LeaveAlternateScreen).unwrap(); } @@ -804,9 +807,6 @@ impl Drop for Stdout { ) .unwrap(); - #[cfg(not(target_os = "windows"))] - execute!(self.stdout, PopKeyboardEnhancementFlags).unwrap(); - terminal::disable_raw_mode().unwrap(); } } |