summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-08-05 19:41:54 -0400
committerJune McEnroe <june@causal.agency>2019-08-05 19:41:54 -0400
commit758d0774854c723eb4ba78d6202a7231b848a468 (patch)
treeb16d28bf475abd8cfb6a6a8225255676c6e6b6ae
parentHandle DECSET/DECRST for cursor (diff)
downloadstream-758d0774854c723eb4ba78d6202a7231b848a468.tar.gz
stream-758d0774854c723eb4ba78d6202a7231b848a468.zip
Implement RI
-rw-r--r--term.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/term.c b/term.c
index 22eb621..bb5d195 100644
--- a/term.c
+++ b/term.c
@@ -116,6 +116,7 @@ static char updateNUL(wchar_t ch) {
 }
 
 enum C1 {
+	RI  = 'M',
 	CSI = '[',
 	OSC = ']',
 	ST  = '\\',
@@ -131,6 +132,15 @@ static char updateESC(wchar_t ch) {
 		case '(': discard = true; return ESC;
 		case '=': return NUL;
 		case '>': return NUL;
+
+		case RI: {
+			move(
+				cell(scroll.top + 1, 0), cell(scroll.top, 0),
+				cols * (scroll.bot - scroll.top)
+			);
+			clear(cell(scroll.top, 0), cell(scroll.top, cols - 1));
+		}
+
 		case CSI: return CSI;
 		case OSC: return OSC;
 		default:  return unhandled("ESC %lc", ch);