From df46e00f602aa4291c52014f09ca23a86aad5893 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 6 Aug 2019 15:07:56 -0400 Subject: Implement SU and SD --- term.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/term.c b/term.c index 18eeb66..e77ab67 100644 --- a/term.c +++ b/term.c @@ -248,6 +248,8 @@ enum CSI { EL, DL = 'M', DCH = 'P', + SU = 'S', + SD = 'T', ECH = 'X', VPA = 'd', SM = 'h', @@ -331,6 +333,9 @@ static char updateCSI(wchar_t ch) { clear(cell(y, cols - i), cell(y, cols - 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)); + break; case SM: { switch (ps[0]) { break; case IRM: insert = true; @@ -347,6 +352,7 @@ static char updateCSI(wchar_t ch) { break; case SGR: updateSGR(ps, p + 1); break; case DECSTBM: { + // FIXME: Prevent bot < top. scroll.top = (n > 0 ? ps[0] - 1 : 0); scroll.bot = (n > 1 ? ps[1] - 1 : rows - 1); } -- cgit 1.4.1