From 448c668d90f93f91be6f9d6c4690fd7ce7680316 Mon Sep 17 00:00:00 2001 From: Hernawan Fa'iz Abdillah Date: Mon, 24 Jul 2023 10:39:17 +0700 Subject: [PATCH] move pop key enhancement flags beside other mode change --- src/engine.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/engine.rs b/src/engine.rs index 3f070359..b5387628 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -599,6 +599,10 @@ impl Reedline { let result = self.read_line_helper(prompt); + if self.use_kitty_protocol { + let _ = execute!(io::stdout(), event::PopKeyboardEnhancementFlags); + } + terminal::disable_raw_mode()?; result @@ -763,9 +767,6 @@ 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);