From 80c0c07250d22f69d3fa05cb1700302d66180eb8 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Mon, 28 Sep 2026 16:19:42 +0300 Subject: perf: send scrolling pane output as row shifts and skip blank cells (#4711) * perf: send scrolling pane output as row shifts and skip blank cells * fix: keep expanded scroll patches disjoint for the fast presentation path --- crates/ghostty-vt/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crates') diff --git a/crates/ghostty-vt/src/lib.rs b/crates/ghostty-vt/src/lib.rs index 056ff142..7ee1e751 100644 --- a/crates/ghostty-vt/src/lib.rs +++ b/crates/ghostty-vt/src/lib.rs @@ -3381,6 +3381,17 @@ impl<'a> RowCellIter<'a> { unsafe { ffi::ghostty_render_state_row_cells_select(self.cells.raw, x).into_result() } } + /// Whether the current cell was never written: no text, default style, + /// narrow, and no hyperlink. One read replaces the style and text lookups + /// for the blank cells that fill most wide panes. + pub fn is_default_blank(&self) -> Result { + // Packed cell bits 0..44 hold content, style id, and width; bit 45 is + // the hyperlink flag. Protection (44) and OSC 133 semantic marks + // (46..48) do not change how a cell renders. + const PRESENTATION_BITS: u64 = ((1 << 44) - 1) | (1 << 45); + Ok(self.raw_cell()? & PRESENTATION_BITS == 0) + } + fn raw_cell(&self) -> Result { let mut raw = ffi::GhosttyCell::default(); unsafe { -- cgit v1.2.3