Commit: 6c1c760e1d0fbef8905ec2ca5e999a31f26f14ec
Parent: 6fbdb285997f8f06f5c15c25e2260e5b7ca65539
Author: Randy Palamar
Date: Sun, 1 Sep 2024 16:57:25 -0600
support DECSC/DECRC (save/restore cursor)
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/terminal.c b/terminal.c
@@ -876,6 +876,12 @@ handle_escape(Term *t, s8 *raw, Arena a)
cursor_move_to(t, t->cursor.pos.y - 1, t->cursor.pos.x);
}
break;
+ case '7': /* DECSC: Save Cursor */
+ cursor_alt(t, 1);
+ break;
+ case '8': /* DECRC: Restore Cursor */
+ cursor_alt(t, 0);
+ break;
default:
fprintf(stderr, "unknown escape sequence: ESC %c (0x%02x)\n", cp, cp);
break;
@@ -984,6 +990,11 @@ check_if_escape_moves_cursor(Term *t, s8 *raw)
if (t->cursor.pos.y != 0)
result = EMC_CURSOR_MOVED;
break;
+ case '7': break;
+ case '8':
+ if (!equal_iv2(t->cursor.pos, t->saved_cursors[t->view_idx].pos))
+ result = EMC_CURSOR_MOVED;
+ break;
default: break;
}
return result;