Skip to content

Commit

Permalink
Implement CSI-K, tweak tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdphk committed Jan 12, 2018
1 parent 945d2e1 commit dc0f151
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/varnishtest/tests/u00010.vtc
Expand Up @@ -18,4 +18,4 @@ client c1 {
rxresp
} -run

process p1 -need-bytes 2000 -screen_dump -write {q} -wait
process p1 -need-bytes 1000 -screen_dump -write {q} -wait
2 changes: 1 addition & 1 deletion bin/varnishtest/tests/u00011.vtc
Expand Up @@ -24,4 +24,4 @@ process p1 -writeln {quit}

process p1 -need-bytes 400

process p1 -screen_dump -writeln {quit} -wait
process p1 -screen_dump -write "quit\r" -wait
3 changes: 2 additions & 1 deletion bin/varnishtest/vtc_process.c
Expand Up @@ -714,10 +714,11 @@ cmd_process(CMD_ARGS)
u = strtoumax(av[1], NULL, 0);
av++;
do {
usleep(100000);
usleep(500000);
AZ(pthread_mutex_lock(&p->mtx));
v = p->stdout_bytes;
AZ(pthread_mutex_unlock(&p->mtx));
vtc_log(p->vl, 4, "Have %ju bytes", v);
} while(v < u);
continue;
}
Expand Down
19 changes: 19 additions & 0 deletions bin/varnishtest/vtc_term.c
Expand Up @@ -119,6 +119,25 @@ term_escape(struct term *tp, int c, int n)
vtc_fatal(tp->vl, "ANSI J[%d]", tp->arg[0]);
term_clear(tp);
break;
case 'K':
// erase in line 0=right, 1=left, 2=full line
switch (tp->arg[0]) {
case 0:
for (i = tp->col + 1; i < tp->ncol; i++)
tp->vram[tp->line][i] = ' ';
break;
case 1:
for (i = 0; i < tp->col; i++)
tp->vram[tp->line][i] = ' ';
break;
case 2:
for (i = 0; i < tp->ncol; i++)
tp->vram[tp->line][i] = ' ';
break;
default:
vtc_fatal(tp->vl, "ANSI K[%d]", tp->arg[0]);
}
break;
case 'm':
// Ignore Graphic Rendition settings
break;
Expand Down

0 comments on commit dc0f151

Please sign in to comment.