Index: syscons.c =================================================================== --- syscons.c (revision 187835) +++ syscons.c (working copy) @@ -2635,6 +2635,19 @@ } static void +sc_sync_cursorpos(scr_stat *scp, int col, int row) +{ + + if (col >= scp->xsize) + col = 0; + if (row >= scp->ysize) + row = scp->ysize - 1; + scp->xpos = col; + scp->ypos = row; + scp->cursor_pos = scp->cursor_oldpos = row*scp->xsize + col; +} + +static void scinit(int unit, int flags) { @@ -2743,13 +2756,7 @@ (void *)sc_buffer, FALSE); /* move cursors to the initial positions */ - if (col >= scp->xsize) - col = 0; - if (row >= scp->ysize) - row = scp->ysize - 1; - scp->xpos = col; - scp->ypos = row; - scp->cursor_pos = scp->cursor_oldpos = row*scp->xsize + col; + sc_sync_cursorpos(scp, col, row); if (sc_init_emulator(scp, SC_DFLT_TERM)) sc_init_emulator(scp, "*"); @@ -2763,6 +2770,9 @@ sc->dev[0] = sc_alloc_tty(0, "ttyv%r", unit * MAXCONS); scp = alloc_scp(sc, sc->first_vty); SC_STAT(sc->dev[0]) = scp; + + /* move cursors to the initial positions */ + sc_sync_cursorpos(scp, col, row); } sc->cur_scp = scp;