mirror of
https://github.com/atuinsh/atuin.git
synced 2025-02-28 16:29:34 +01:00
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
This commit is contained in:
parent
5738d06282
commit
f96cb6903d
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user