aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-07-16 14:45:36 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-07-18 14:14:21 +0000
commit5f0ceb72f176caf7673ea1d4bc5195f26f4b4df7 (patch)
treed5dc946ae5af95369f47924e041f161bc8ae6ee2 /terminal.h
parentMerge branch 'refactor-shm-buffer-management' (diff)
csi: erase scrollback: cancel selection if it touches the scrollback
This breaks out the scrollback erasing logic for \E[3J from csi.c, and moves it to the new function term_erase_scrollback(), and changes the logic to calculate the start and end row (absolute) numbers of the scrollback, and only iterate those, instead of iterating *all* rows, filtering out those that are on-screen. It also adds an intersection range check of the selection range, and cancels the selection if it touches any of the deleted scrollback rows. This fixes a crash when trying to render the next frame, since the selection now references rows that have been freed. Closes #633
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/terminal.h b/terminal.h
index b02036a2..d699d644 100644
--- a/terminal.h
+++ b/terminal.h
@@ -662,6 +662,7 @@ void term_damage_scroll(
void term_erase(
struct terminal *term, const struct coord *start, const struct coord *end);
+void term_erase_scrollback(struct terminal *term);
int term_row_rel_to_abs(const struct terminal *term, int row);
void term_cursor_home(struct terminal *term);