aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-16 11:00:25 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-16 11:00:25 +0000
commit1006608093fbbe19103f63fc1140b122a3904500 (patch)
treeec31e9643e7d6debd54c0250afa174ce71fa76e6 /csi.c
parentwayland: add FDs to FDM as soon as the FDs are ready (diff)
alt-screen: use a custom 'saved' cursor when switching to alt screen
This fixes an issue where we failed to restore the cursor correctly when exiting from the alternate screen, if the client had sent escapes to save the cursor position while inside the alternate screen. This was because we used the *same* storage for saving the cursor position through escapes, as for saving it when entering the alternate screen. Fix by using a custom variable dedicated to normal <--> alt screen switching.
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/csi.c b/csi.c
index 6147f27b..189188c6 100644
--- a/csi.c
+++ b/csi.c
@@ -761,7 +761,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
break;
case 'u':
- term_restore_cursor(term);
+ term_restore_cursor(term, &term->saved_cursor);
break;
case 't': {
@@ -1014,7 +1014,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
selection_cancel(term);
term->grid = &term->alt;
- term->saved_cursor = term->cursor;
+ term->alt_saved_cursor = term->cursor;
term_cursor_to(term, term->cursor.point.row, term->cursor.point.col);
@@ -1137,7 +1137,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
selection_cancel(term);
term->grid = &term->normal;
- term_restore_cursor(term);
+ term_restore_cursor(term, &term->alt_saved_cursor);
tll_free(term->alt.damage);
tll_free(term->alt.scroll_damage);