summaryrefslogtreecommitdiff
path: root/console
diff options
context:
space:
mode:
authorJames Clarke <jrtc27@jrtc27.com>2015-09-12 00:42:05 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-09-12 12:00:48 +0200
commit90ae149104ee0f55309f8fc10fecedb7b2aef472 (patch)
tree52563ee9c4630f6060a95ccd2aee76d74d22ff20 /console
parent25ddda6354c4b70bcd8abb79770764d8ee3d6fc3 (diff)
Add support for ANSI.SYS SCP/RCP escape codes
This adds support for CSI s and u, which are equivalent to ESC 7 and 8, saving/restoring the cursor position. * console/display.c (handle_esc_bracket): Added support for CSI s and u.
Diffstat (limited to 'console')
-rw-r--r--console/display.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/console/display.c b/console/display.c
index eb420fd1..98c70f50 100644
--- a/console/display.c
+++ b/console/display.c
@@ -1210,6 +1210,18 @@ handle_esc_bracket (display_t display, char op)
user->cursor.col -= (parse->params[0] ?: 1);
limit_cursor (display);
break;
+ case 's': /* ANSI.SYS: Save cursor and attributes. */
+ /* Save cursor position: <scp>. */
+ display->cursor.saved_x = user->cursor.col;
+ display->cursor.saved_y = user->cursor.row;
+ break;
+ case 'u': /* ANSI.SYS: Restore cursor and attributes. */
+ /* Restore cursor position: <rcp>. */
+ user->cursor.col = display->cursor.saved_x;
+ user->cursor.row = display->cursor.saved_y;
+ /* In case the screen was larger before: */
+ limit_cursor (display);
+ break;
case 'l':
/* Reset mode. */
for (i = 0; i < parse->nparams; i++)