From b0a2c54fe841545d21e79b5bb559cc2dc9d3353f Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 23 Jun 2019 18:02:49 +0200 Subject: vt: wip: implement scrolling region This is largely untested, but existing scrolling code has been converted to using a terminal-global scrolling region that is defined as start-end of the scrollable region. This is compared to the old code where the scrolling region where defined in terms of marginals, counted in lines from top and from bottom. --- csi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'csi.c') diff --git a/csi.c b/csi.c index e4a60eda..0200e6a3 100644 --- a/csi.c +++ b/csi.c @@ -380,6 +380,21 @@ csi_dispatch(struct terminal *term, uint8_t final) break; } + case 'r': { + int start = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1; + int end = term->vt.params.idx > 1 + ? term->vt.params.v[1].value : term->grid.rows; + + /* 1-based */ + term->grid.scrolling_region.start = start - 1; + term->grid.scrolling_region.end = end - 1; + + tll_free(term->grid.damage); + grid_damage_update(&term->grid, 0, term->grid.rows * term->grid.cols); + grid_cursor_to(&term->grid, 0, 0); + break; + } + case 't': /* * TODO: xterm's terminfo specifies *both* \e[?1049h *and* -- cgit v1.3