aboutsummaryrefslogtreecommitdiff
path: root/src/raw_input.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-19 22:23:49 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-19 22:24:20 +0300
commit052f20214b1be904924df8d50d01e31198098922 (patch)
tree209ec134a8dc7e90b0f141fa046b31cda835c85c /src/raw_input.rs
parent46a2b259a71828e7fcdeab1f67ef675304e2ca14 (diff)
fix: preserve windows terminal multiline paste
refs #670
Diffstat (limited to 'src/raw_input.rs')
-rw-r--r--src/raw_input.rs11
1 files changed, 11 insertions, 0 deletions
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<RawInputEvent> {
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<Vec<u8>> {
let mut chunks = self.drain_available_chunks();