summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-08-07 15:08:16 -0400
committerJune McEnroe <june@causal.agency>2019-08-07 15:08:16 -0400
commit0c74f831379f23e02bbd0e7b00207d8b6df8772e (patch)
tree1554d7c7fb4d6d0d9c227cec13896acce5b166e1
parentImplement IL (diff)
downloadstream-0c74f831379f23e02bbd0e7b00207d8b6df8772e.tar.gz
stream-0c74f831379f23e02bbd0e7b00207d8b6df8772e.zip
Implement DECSC and DECRC
-rw-r--r--term.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/term.c b/term.c
index 8c16c82..719e630 100644
--- a/term.c
+++ b/term.c
@@ -55,6 +55,9 @@ static bool insert;
 static struct {
 	uint top, bot;
 } scroll;
+static struct {
+	uint y, x;
+} save;
 
 static struct Style style;
 static struct Cell *cells;
@@ -128,6 +131,8 @@ static char updateNUL(wchar_t ch) {
 }
 
 enum C1 {
+	DECSC = '7',
+	DECRC = '8',
 	IND = 'D',
 	RI  = 'M',
 	CSI = '[',
@@ -146,6 +151,9 @@ static char updateESC(wchar_t ch) {
 		break; case CSI: return CSI;
 		break; case OSC: return OSC;
 
+		break; case DECSC: save.y = y; save.x = x;
+		break; case DECRC: y = save.y; x = save.x;
+
 		break; case IND: scrollUp(1);
 		break; case RI:  scrollDown(1);