diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 48ac62f30652..f3ffa837a7fa 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -2946,11 +2946,12 @@ ansi_put(scr_stat *scp, u_char *buf, int len) case 0x09: /* non-destructive tab */ mark_for_update(scp, scp->cursor_pos); scp->cursor_pos += (8 - scp->xpos % 8u); - mark_for_update(scp, scp->cursor_pos); if ((scp->xpos += (8 - scp->xpos % 8u)) >= scp->xsize) { scp->xpos = 0; scp->ypos++; + scp->cursor_pos = scp->xsize * scp->ypos; } + mark_for_update(scp, scp->cursor_pos); break; case 0x0a: /* newline, same pos */