From 052f20214b1be904924df8d50d01e31198098922 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Fri, 19 Jun 2026 22:23:49 +0300 Subject: fix: preserve windows terminal multiline paste refs #670 --- src/raw_input.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/raw_input.rs') diff --git a/src/raw_input.rs b/src/raw_input.rs index 5638cd7a..b07641a5 100644 --- a/src/raw_input.rs +++ b/src/raw_input.rs @@ -142,6 +142,11 @@ impl RawInputFramer { self.byte_framer.has_pending_input() } + #[cfg(any(windows, test))] + pub(crate) fn has_pending_bracketed_paste(&self) -> bool { + self.byte_framer.has_pending_bracketed_paste() + } + pub(crate) fn flush_timeout(&mut self) -> Vec { Self::events_from_chunks(self.byte_framer.flush_timeout()) } @@ -198,6 +203,12 @@ impl RawInputByteFramer { !self.buffer.is_empty() } + #[cfg(any(windows, test))] + pub(crate) fn has_pending_bracketed_paste(&self) -> bool { + self.buffer.starts_with(BRACKETED_PASTE_START) + && find_subsequence(&self.buffer, BRACKETED_PASTE_END).is_none() + } + pub(crate) fn flush_timeout(&mut self) -> Vec> { let mut chunks = self.drain_available_chunks(); -- cgit v1.2.3