diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-28 16:19:42 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-28 16:19:42 +0300 |
| commit | 80c0c07250d22f69d3fa05cb1700302d66180eb8 (patch) | |
| tree | 9e1903d65c83263354be4b2166f3a7c92dc2a8e2 /src/pane | |
| parent | 8c8cb49c237eec2f82192dd831ec7308905f2c0a (diff) | |
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
Diffstat (limited to 'src/pane')
| -rw-r--r-- | src/pane/terminal.rs | 15 | ||||
| -rw-r--r-- | src/pane/terminal/migration_tests.rs | 7 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/pane/terminal.rs b/src/pane/terminal.rs index 8ac4bd1c..24379d22 100644 --- a/src/pane/terminal.rs +++ b/src/pane/terminal.rs @@ -2677,6 +2677,7 @@ fn ghostty_collect_dirty_patch( let mut grapheme_bytes = Vec::new(); let mut symbol_scratch = String::new(); let mut patch_rows = Vec::new(); + let blank = blank_cell_data(default_fg, default_bg); while let Some(y) = rows.next_dirty() { if y >= area_height { break; @@ -2692,6 +2693,15 @@ fn ghostty_collect_dirty_patch( let mut patch_cells = Vec::with_capacity(usize::from(area_width)); let mut x = 0u16; while x < area_width && cells.next() { + match cells.is_default_blank() { + Ok(true) => { + patch_cells.push(blank.clone()); + x += 1; + continue; + } + Ok(false) => {} + Err(_) => fallback!("raw_cell_error"), + } let Ok(basic) = cells.basic_data() else { fallback!("basic_data_error"); }; @@ -2720,10 +2730,7 @@ fn ghostty_collect_dirty_patch( patch_cells.push(cell_data_from_style(symbol, style)); x += 1; } - while x < area_width { - patch_cells.push(blank_cell_data(default_fg, default_bg)); - x += 1; - } + patch_cells.resize(usize::from(area_width), blank.clone()); patch_rows.push((y, patch_cells)); } diff --git a/src/pane/terminal/migration_tests.rs b/src/pane/terminal/migration_tests.rs index 09e5df01..aaf91f27 100644 --- a/src/pane/terminal/migration_tests.rs +++ b/src/pane/terminal/migration_tests.rs @@ -311,6 +311,13 @@ fn incremental_rows_reconstruct_full_render() { b"\x1b[3;4H", b"\x1b[?1049hALT", b"\x1b[?1049l", + // Blank cells must match the full renderer under every color source. + b"\x1b[3;1H\x1b[44m\x1b[2K\x1b[0m", + b"\x1b[4;2H\x1b[7m \x1b[0m \x1b[8m \x1b[0m", + b"\x1b[?5h", + b"\x1b[?5l", + b"\x1b[5;1H\x1b]133;A\x07$ \x1b]133;B\x07 \x1b]133;C\x07", + b"\x1b[5;1H\r\n\r\nscrolled\r\n", ] { incremental.write(bytes); full.write(bytes); |
