diff --git a/src/conio/cterm.c b/src/conio/cterm.c index e110de307a7a1801d1a4e932ad3149f23b3b70b2..024ac0081904d4ca5af77f46db9efe954e141437 100644 --- a/src/conio/cterm.c +++ b/src/conio/cterm.c @@ -2156,8 +2156,50 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int * break; } else if (seq->ctrl_func[1]) { // Control Function with Intermediate Character + // Shift left TODO: Does this interact with scrolling regions? + if (strcmp(seq->ctrl_func, " @") == 0) { + seq_default(seq, 0, 1); + i = seq->param_int[0]; + if(i > cterm->width) + i = cterm->width; + MOVETEXT(cterm->x + i, cterm->y, cterm->x + cterm->width - 1, cterm->y + cterm->height - 1, cterm->x, cterm->y); + j = i * cterm->height; + vc = malloc(j * sizeof(*vc)); + if (vc != NULL) { + for(k=0; k < j; k++) { + vc[k].ch=' '; + vc[k].legacy_attr=cterm->attr; + vc[k].fg=cterm->fg_color; + vc[k].bg=cterm->bg_color; + vc[k].font = ciolib_attrfont(cterm->attr); + } + vmem_puttext(cterm->x + cterm->width - i, cterm->y, cterm->x + cterm->width - 1, cterm->y + cterm->height - 1, vc); + free(vc); + } + } + // Shift right TODO: Does this interact with scrolling regions? + else if (strcmp(seq->ctrl_func, " A") == 0) { + seq_default(seq, 0, 1); + i = seq->param_int[0]; + if(i > cterm->width) + i = cterm->width; + MOVETEXT(cterm->x, cterm->y, cterm->x + cterm->width - 1 - i, cterm->y + cterm->height - 1, cterm->x + i, cterm->y); + j = i * cterm->height; + vc = malloc(j * sizeof(*vc)); + if (vc != NULL) { + for(k=0; k < j; k++) { + vc[k].ch=' '; + vc[k].legacy_attr=cterm->attr; + vc[k].fg=cterm->fg_color; + vc[k].bg=cterm->bg_color; + vc[k].font = ciolib_attrfont(cterm->attr); + } + vmem_puttext(cterm->x, cterm->y, cterm->x + i - 1, cterm->y + cterm->height - 1, vc); + free(vc); + } + } // Font Select - if (strcmp(seq->ctrl_func, " D") == 0) { + else if (strcmp(seq->ctrl_func, " D") == 0) { seq_default(seq, 0, 0); seq_default(seq, 1, 0); switch(seq->param_int[0]) { diff --git a/src/conio/cterm.txt b/src/conio/cterm.txt index e6c50ef369459625cec633ff9fba1d17f1cc935a..e363e14033add4880c721909f862eaf43dff5526 100644 --- a/src/conio/cterm.txt +++ b/src/conio/cterm.txt @@ -241,6 +241,15 @@ CSI Pn @ SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf +CSI Pn SP @ + Shift Left + Defaults: Pn = 1 + Shifts the contents of the screen left Pn columns(s) with + leftmost columns going off-screen and the resulting hole being + filled with the current attribute. + + SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf + CSI Pn A Cursor Up Defaults: Pn = 1 @@ -250,6 +259,15 @@ CSI Pn A SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf +CSI Pn SP A + Shift Right + Defaults: Pn = 1 + Shifts the contents of the screen right Pn columns(s) with + rightmost columns going off-screen and the resulting hole being + filled with the current attribute. + + SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf + CSI Pn B Cursor Down Defaults: Pn = 1