From 8cc8c4e4c63f77a59d33384607b530b82e93fb8e Mon Sep 17 00:00:00 2001 From: Hernawan Fa'iz Abdillah Date: Fri, 21 Jul 2023 22:44:44 +0700 Subject: [PATCH] move pop key enhancement flags just before loop exit --- src/engine.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine.rs b/src/engine.rs index 665ce07d..c5525893 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -168,9 +168,6 @@ impl Drop for Reedline { if self.bracket_paste_enabled { let _ = execute!(io::stdout(), DisableBracketedPaste); } - if self.use_kitty_protocol { - let _ = execute!(io::stdout(), event::PopKeyboardEnhancementFlags); - } } } @@ -765,6 +762,9 @@ impl Reedline { for event in reedline_events.drain(..) { match self.handle_event(prompt, event)? { EventStatus::Exits(signal) => { + if self.use_kitty_protocol { + let _ = execute!(io::stdout(), event::PopKeyboardEnhancementFlags); + } // Move the cursor below the input area, for external commands or new read_line call self.painter.move_cursor_to_end()?; return Ok(signal);