aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-23 15:57:07 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-23 15:57:07 +0000
commitf5a6304850fd7344f72355416cfbfd69b76482c4 (patch)
tree358ae1680be93f61d57b4aa4f8283acbba23e36b /csi.c
parentgrid: swap rows doesn't mark rows as dirty (diff)
term: make sure to update 'current row' when restoring saved cursor
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/csi.c b/csi.c
index 4a4d321a..cfe66b93 100644
--- a/csi.c
+++ b/csi.c
@@ -576,6 +576,14 @@ csi_dispatch(struct terminal *term, uint8_t final)
break;
}
+ case 's':
+ term->saved_cursor = term->cursor;
+ break;
+
+ case 'u':
+ term_restore_cursor(term);
+ break;
+
case 't': {
unsigned param = vt_param_get(term, 0, 0);
@@ -794,8 +802,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
if (term->grid == &term->alt) {
term->grid = &term->normal;
- term->cursor = term->saved_cursor;
- term_cursor_to(term, term->cursor.row, term->cursor.col);
+ term_restore_cursor(term);
tll_free(term->alt.damage);
tll_free(term->alt.scroll_damage);