diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-06-23 13:03:06 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-06-23 13:03:22 +0000 |
| commit | de7dcf1a5c89bc296e5b96931cd0523b3b28c411 (patch) | |
| tree | bed4cf46b7e06f47b2505380f231fc2986f1a386 /csi.c | |
| parent | vt: initial implementation of alt screen + 256 colors (diff) | |
csi: save and restore cursor when switching to and from alt screen
Diffstat (limited to 'csi.c')
| -rw-r--r-- | csi.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -423,7 +423,8 @@ csi_dispatch(struct terminal *term, uint8_t final) if (term->grid.cells != term->grid.alt_grid) { term->grid.cells = term->grid.alt_grid; - /* TODO: save cursor position */ + term->grid.alt_saved_cursor.row = term->grid.cursor.row; + term->grid.alt_saved_cursor.col = term->grid.cursor.col; tll_free(term->grid.damage); grid_erase(&term->grid, 0, term->grid.cols * term->grid.rows); @@ -455,7 +456,10 @@ csi_dispatch(struct terminal *term, uint8_t final) if (term->grid.cells == term->grid.alt_grid) { term->grid.cells = term->grid.normal_grid; - /* TODO: restore cursor position */ + term->grid.cursor.row = term->grid.alt_saved_cursor.row; + term->grid.cursor.col = term->grid.alt_saved_cursor.col; + term->grid.linear_cursor = grid_cursor_linear( + &term->grid, term->grid.cursor.row, term->grid.cursor.col); tll_free(term->grid.damage); grid_damage_update( |
