aboutsummaryrefslogtreecommitdiff
path: root/src/pane/terminal.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-28 16:19:42 +0300
committerGitHub <noreply@github.com>2026-09-28 16:19:42 +0300
commit80c0c07250d22f69d3fa05cb1700302d66180eb8 (patch)
tree9e1903d65c83263354be4b2166f3a7c92dc2a8e2 /src/pane/terminal.rs
parent8c8cb49c237eec2f82192dd831ec7308905f2c0a (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/terminal.rs')
-rw-r--r--src/pane/terminal.rs15
1 files changed, 11 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));
}