diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-16 14:27:20 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-16 14:27:20 +0000 |
| commit | bcf46d9eab5cd9d96c4de473cb2c5281cdf8e0f6 (patch) | |
| tree | 0633ad3f8904e47003c68d744f079f5c32596078 /terminal.c | |
| parent | Merge branch 'dont-crash-when-keyboard-repeat-rate-is-zero' (diff) | |
| parent | csi: implement DECSET 47 - use alternate screen buffer (diff) | |
Merge branch 'decset-1047-and-1048'
Diffstat (limited to 'terminal.c')
| -rw-r--r-- | terminal.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -2255,12 +2255,24 @@ term_reset_view(struct terminal *term) } void +term_save_cursor(struct terminal *term) +{ + term->grid->saved_cursor = term->grid->cursor; + term->vt.saved_attrs = term->vt.attrs; + term->saved_charsets = term->charsets; +} + +void term_restore_cursor(struct terminal *term, const struct cursor *cursor) { int row = min(cursor->point.row, term->rows - 1); int col = min(cursor->point.col, term->cols - 1); + term_cursor_to(term, row, col); term->grid->cursor.lcf = cursor->lcf; + + term->vt.attrs = term->vt.saved_attrs; + term->charsets = term->saved_charsets; } void |
