Commit 3c5bb707 authored by deuce's avatar deuce
Browse files

Fix CSI < c response.

Add CSI I support.
Fix CSI SP d support.
parent 4dca8f70
......@@ -798,7 +798,7 @@ delete_tabstop(struct cterminal *cterm, int pos)
{
int i;
for (i = 0; i < cterm->tab_count && cterm->tabs[i] < pos; i++) {
for (i = 0; i < cterm->tab_count && cterm->tabs[i] <= pos; i++) {
if (cterm->tabs[i] == pos) {
memcpy(&cterm->tabs[i], &cterm->tabs[i+1], (cterm->tab_count - i - 1) * sizeof(cterm->tabs[0]));
cterm->tab_count--;
......@@ -2146,7 +2146,7 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int *
strcat(tmp, ";6");
if (cio_api.mouse)
strcat(tmp, ";7");
strcat(tmp, "n");
strcat(tmp, "c");
}
}
if(*tmp && strlen(retbuf) + strlen(tmp) < retsize)
......@@ -2868,8 +2868,7 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int *
break;
}
}
// Font Select
else if (strcmp(seq->ctrl_func, " c") == 0) {
else if (strcmp(seq->ctrl_func, " d") == 0) {
if (seq->param_count > 0) {
delete_tabstop(cterm, seq->param_int[0]);
}
......@@ -3076,6 +3075,24 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int *
GOTOXY(col,row);
break;
case 'I': /* TODO? Cursor Forward Tabulation */
case 'Y': /* Cursor Line Tabulation */
seq_default(seq, 0, 1);
if (seq->param_int[0] < 1)
break;
TERM_XY(&col, &row);
for(i = 0; i < cterm->tab_count; i++) {
if(cterm->tabs[i] > col)
break;
}
if (i == cterm->tab_count)
break;
for (k = 0; k < seq->param_int[0] && i + k < cterm->tab_count; k++) {
if (cterm->tabs[i + k] <= TERM_MAXX)
col = cterm->tabs[i + k];
else
break;
}
GOTOXY(col,row);
break;
case 'J': /* Erase In Page */
seq_default(seq, 0, 0);
......@@ -3222,25 +3239,7 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int *
vmem_puttext(col2, row2, col2 + i - 1, row2, vc);
free(vc);
break;
case 'Y': /* Cursor Line Tabulation */
seq_default(seq, 0, 1);
if (seq->param_int[0] < 1)
break;
TERM_XY(&col, &row);
for(i = 0; i < cterm->tab_count; i++) {
if(cterm->tabs[i] > col)
break;
}
if (i == cterm->tab_count)
break;
for (k = 0; k < seq->param_int[0] && i + k < cterm->tab_count; k++) {
if (cterm->tabs[i + k] <= TERM_MAXX)
col = cterm->tabs[i + k];
else
break;
}
GOTOXY(col,row);
break;
// for case 'Y': see case 'I':
case 'Z': /* Cursor Backward Tabulation */
seq_default(seq, 0, 1);
i=strtoul(cterm->escbuf+1,NULL,10);
......
......@@ -433,6 +433,14 @@ CSI Pn1 ; Pn2 H (CUP)
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
CSI Pn I (CHT)
Cursor Forward Tabulation
Defaults: Pn = 1
Move the cursor to the Pn-th next tab stop.
Basically the same as sending TAB Pn times.
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
CSI Ps J (ED)
Erase in Page
Defaults: Ps = 0
......@@ -480,8 +488,8 @@ CSI Pn M (DL)
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
SOURCE: BANSI.TXT
CSI = Ps M (STERMSAM)
SyncTERM Set ANSI Music
CSI = Ps M (CTSAM)
CTerm Set ANSI Music
NON-STANDARD EXTENSION.
Defaults: Ps = 0
Sets the current state of ANSI music parsing.
......@@ -576,7 +584,7 @@ CSI Pn ` (HPA)
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
CSI Pn a
CSI Pn a (HPR)
Cursor Position Forward
Defaults: Pn = 1
Moves the cursor position forward Pn columns from the current position.
......@@ -585,7 +593,7 @@ CSI Pn a
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
CSI Pn b
CSI Pn b (REP)
Repeat
Defaults: Pn = 1
Repeats the previous graphic character Pn times. Will not repeat
......@@ -593,7 +601,7 @@ CSI Pn b
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
CSI Ps c
CSI Ps c (DA)
Device Attributes
Defaults: Ps = 0
If Ps is 0, CTerm will reply with the sequence:
......@@ -607,14 +615,7 @@ CSI Ps c
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
CSI Pn SP c
Tab Stop Remove
Defaults: None
Removes a tab stop at postion Pn.
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
CSI < Ps c
CSI < Ps c (CTDA)
CTerm Device Attributes
Defaults: Ps = 0
......@@ -632,13 +633,20 @@ CSI < Ps c
6 - Extended palette is available
7 - Mouse is available
CSI Ps d
CSI Ps d (VPA)
Line Position Absolute
Defaults: Ps = 1
Moves to row specified by Ps.
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
CSI Pn SP d (TSR)
Tab Stop Remove
Defaults: None
Removes a tab stop at postion Pn.
SOURCE: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
CSI Ps e
Line Position Relative
Defaults: Ps = 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment