Skip to content

Commit

Permalink
Save cursor position on primary buffer with CSI priv 1049
Browse files Browse the repository at this point in the history
  • Loading branch information
inzanity authored and Santtu Lakkala committed Aug 10, 2019
1 parent f4b39f5 commit 3497ab9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,11 +970,13 @@ static void interpret_csi_priv_mode(Vt *t, int param[], int pcount, bool set)
case 1047:
if (!set)
buffer_clear(&t->buffer_alternate);
if (set && param[i] == 1049)
cursor_save(t);
t->buffer = set ? &t->buffer_alternate : &t->buffer_normal;
if (!set && param[i] == 1049)
cursor_restore(t);
vt_dirty(t);
if (param[i] != 1049)
break;
/* fall through */
break;
case 1048: /* save/restore cursor */
if (set)
cursor_save(t);
Expand Down

0 comments on commit 3497ab9

Please sign in to comment.