From 6e7d415bcfc09bc5ad293cf1db919e9d17c28034 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Fri, 11 Sep 2026 02:08:31 +0300 Subject: fix: keep terminal snapshots consistent while scrolling (#3928) refs #3900 --- src/terminal/runtime.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/terminal') diff --git a/src/terminal/runtime.rs b/src/terminal/runtime.rs index 57d45b92..a409545b 100644 --- a/src/terminal/runtime.rs +++ b/src/terminal/runtime.rs @@ -411,22 +411,18 @@ impl TerminalRuntime { self.0.render(frame, area, show_cursor); } - pub(crate) fn collect_dirty_patch( + pub(crate) fn collect_dirty_patch_snapshot( &self, area_width: u16, area_height: u16, - ) -> crate::pane::TerminalDirtyPatchOutcome { - self.0.collect_dirty_patch(area_width, area_height) + ) -> Option { + self.0.collect_dirty_patch_snapshot(area_width, area_height) } pub fn visible_hyperlinks(&self, area: Rect) -> Vec<((u16, u16), String, String)> { self.0.visible_hyperlinks(area) } - pub(crate) fn kitty_graphics_may_have_placements(&self) -> bool { - self.0.kitty_graphics_may_have_placements() - } - pub fn kitty_image_placements_with_data_filter( &self, needs_data: F, @@ -572,6 +568,13 @@ impl TerminalRuntime { #[cfg(test)] impl TerminalRuntime { + pub(crate) fn test_contend_during_dirty_collection( + &self, + bytes: Vec, + ) -> (std::sync::mpsc::Sender<()>, std::thread::JoinHandle) { + self.0.test_contend_during_dirty_collection(bytes) + } + pub(crate) fn test_with_channel(cols: u16, rows: u16) -> (Self, mpsc::Receiver) { let (runtime, rx) = crate::pane::PaneRuntime::test_with_channel(cols, rows); (Self(runtime), rx) -- cgit v1.2.3