summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-08-07 14:55:00 -0400
committerJune McEnroe <june@causal.agency>2019-08-07 14:55:00 -0400
commitd0074af8cd0ea4ca57b5029b25bb0dc39cf19747 (patch)
tree5e0d130affe13acad8464cbf1c9e66286a88ef8c
parentImplement IND (diff)
downloadstream-d0074af8cd0ea4ca57b5029b25bb0dc39cf19747.tar.gz
stream-d0074af8cd0ea4ca57b5029b25bb0dc39cf19747.zip
Implement ICH
-rw-r--r--term.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/term.c b/term.c
index 6e953a2..3da2623 100644
--- a/term.c
+++ b/term.c
@@ -238,6 +238,7 @@ enum { CSIMax = 5 + 2 * 3 };
 
 enum CSI {
 	DEC = '?',
+	ICH = '@',
 	CUU = 'A',
 	CUD,
 	CUF,
@@ -335,6 +336,12 @@ static char updateCSI(wchar_t ch) {
 			clear(cell(y, cols - i), cell(y, cols - 1));
 		}
 
+		break; case ICH: {
+			uint i = MIN((n ? ps[0] : 1), cols - x);
+			move(cell(y, x + i), cell(y, x), cols - x - i);
+			clear(cell(y, x), cell(y, x + i - 1));
+		}
+
 		break; case SU: scrollUp(MIN((n ? ps[0] : 1), scroll.bot - scroll.top));
 		break; case SD: scrollDown(MIN((n ? ps[0] : 1), scroll.bot - scroll.top));