repaint when cursor moves

This commit is contained in:
2026-06-04 14:53:05 +02:00
parent f07b1724d9
commit c31166c087
+14
View File
@@ -1443,16 +1443,19 @@ impl Handler for Terminal {
if self.cursor_col > 0 {
self.cursor_col -= 1;
}
self.mark_line_dirty(self.cursor_row);
}
0x09 => {
let next_tab = (self.cursor_col / 8 + 1) * 8;
self.cursor_col = next_tab.min(self.cols - 1);
self.mark_line_dirty(self.cursor_row);
}
0x0A | 0x0B | 0x0C => {
self.advance_row();
}
0x0D => {
self.cursor_col = 0;
self.mark_line_dirty(self.cursor_row);
}
_ => {}
}
@@ -1712,6 +1715,7 @@ impl Handler for Terminal {
if self.origin_mode { self.scroll_top } else { 0 };
self.cursor_row =
self.cursor_row.saturating_sub(n).max(min_row);
self.mark_line_dirty(self.cursor_row);
}
'B' => {
let n = params.get(0, 1).max(1) as usize;
@@ -1721,6 +1725,7 @@ impl Handler for Terminal {
self.rows - 1
};
self.cursor_row = (self.cursor_row + n).min(max_row);
self.mark_line_dirty(self.cursor_row);
}
// Cursor Forward
'C' => {
@@ -1733,11 +1738,13 @@ impl Handler for Terminal {
old_col,
self.cursor_col
);
self.mark_line_dirty(self.cursor_row);
}
// Cursor Back
'D' => {
let n = params.get(0, 1).max(1) as usize;
self.cursor_col = self.cursor_col.saturating_sub(n);
self.mark_line_dirty(self.cursor_row);
}
'E' => {
let n = params.get(0, 1).max(1) as usize;
@@ -1748,6 +1755,7 @@ impl Handler for Terminal {
};
self.cursor_col = 0;
self.cursor_row = (self.cursor_row + n).min(max_row);
self.mark_line_dirty(self.cursor_row);
}
'F' => {
let n = params.get(0, 1).max(1) as usize;
@@ -1756,6 +1764,7 @@ impl Handler for Terminal {
self.cursor_col = 0;
self.cursor_row =
self.cursor_row.saturating_sub(n).max(min_row);
self.mark_line_dirty(self.cursor_row);
}
// Cursor Horizontal Absolute (CHA)
'G' => {
@@ -1767,6 +1776,7 @@ impl Handler for Terminal {
self.cursor_col,
old_col
);
self.mark_line_dirty(self.cursor_row);
}
// Cursor Position
'H' | 'f' => {
@@ -1780,6 +1790,7 @@ impl Handler for Terminal {
self.cursor_row = (row - 1).min(self.rows - 1);
}
self.cursor_col = (col - 1).min(self.cols - 1);
self.mark_line_dirty(self.cursor_row);
}
// Erase in Display
'J' => {
@@ -2177,6 +2188,7 @@ impl Handler for Terminal {
} else {
self.cursor_row += 1;
}
self.mark_line_dirty(self.cursor_row);
}
fn newline(&mut self) {
@@ -2186,6 +2198,7 @@ impl Handler for Terminal {
} else {
self.cursor_row += 1;
}
self.mark_line_dirty(self.cursor_row);
}
fn reverse_index(&mut self) {
@@ -2194,6 +2207,7 @@ impl Handler for Terminal {
} else {
self.cursor_row -= 1;
}
self.mark_line_dirty(self.cursor_row);
}
fn set_tab_stop(&mut self) {