typedef struct {
Glyph attr; /* current char attributes */
- int x; /* terminal column */
- int y; /* terminal row */
+ int x;
+ int y;
char state;
} TCursor;
{
char *p = csiescseq.buf, *np;
long int v;
+ int sep = ';'; /* colon or semi-colon, but not both */
csiescseq.narg = 0;
if (*p == '?') {
v = -1;
csiescseq.arg[csiescseq.narg++] = v;
p = np;
- if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ)
+ if (sep == ';' && *p == ':')
+ sep = ':'; /* allow override to colon once */
+ if (*p != sep || csiescseq.narg == ESC_ARG_SIZ)
break;
p++;
}
ttywrite(vtiden, strlen(vtiden), 0);
break;
case 'b': /* REP -- if last char is printable print it <n> more times */
- DEFAULT(csiescseq.arg[0], 1);
+ LIMIT(csiescseq.arg[0], 1, 65535);
if (term.lastc)
while (csiescseq.arg[0]-- > 0)
tputc(term.lastc);
void
tcontrolcode(uchar ascii)
{
- size_t i;
-
switch (ascii) {
case '\t': /* HT */
tputtab(1);
return;
case '\b': /* BS */
- for (i = 1; term.c.x && term.line[term.c.y][term.c.x - i].u == 0; ++i)
- ;
- tmoveto(term.c.x - i, term.c.y);
+ tmoveto(term.c.x-1, term.c.y);
return;
case '\r': /* CR */
tmoveto(0, term.c.y);