From owner-freebsd-current@FreeBSD.ORG Wed Jan 28 21:16:31 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F284810656E4 for ; Wed, 28 Jan 2009 21:16:31 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id B00618FC2D for ; Wed, 28 Jan 2009 21:16:31 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 1700D1CEB5; Wed, 28 Jan 2009 22:16:31 +0100 (CET) Date: Wed, 28 Jan 2009 22:16:31 +0100 From: Ed Schouten To: Michiel Boland Message-ID: <20090128211631.GW17198@hoeg.nl> References: <4980C766.50207@boland.org> <20090128211416.GV17198@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XCIqNWEteo88hZlY" Content-Disposition: inline In-Reply-To: <20090128211416.GV17198@hoeg.nl> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: FreeBSD Current Subject: Re: console oddities X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2009 21:16:33 -0000 --XCIqNWEteo88hZlY Content-Type: multipart/mixed; boundary="doUn1Hmx68n+7ij2" Content-Disposition: inline --doUn1Hmx68n+7ij2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > Can you try the attached patch? Obviously I forgot to add the attachment. --=20 Ed Schouten WWW: http://80386.nl/ --doUn1Hmx68n+7ij2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="syscons.diff" Content-Transfer-Encoding: quoted-printable Index: syscons.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- syscons.c (revision 187835) +++ syscons.c (working copy) @@ -2635,6 +2635,19 @@ } =20 static void +sc_sync_cursorpos(scr_stat *scp, int col, int row) +{ + + if (col >=3D scp->xsize) + col =3D 0; + if (row >=3D scp->ysize) + row =3D scp->ysize - 1; + scp->xpos =3D col; + scp->ypos =3D row; + scp->cursor_pos =3D scp->cursor_oldpos =3D row*scp->xsize + col; +} + +static void scinit(int unit, int flags) { =20 @@ -2743,13 +2756,7 @@ (void *)sc_buffer, FALSE); =20 /* move cursors to the initial positions */ - if (col >=3D scp->xsize) - col =3D 0; - if (row >=3D scp->ysize) - row =3D scp->ysize - 1; - scp->xpos =3D col; - scp->ypos =3D row; - scp->cursor_pos =3D scp->cursor_oldpos =3D row*scp->xsize + col; + sc_sync_cursorpos(scp, col, row); =20 if (sc_init_emulator(scp, SC_DFLT_TERM)) sc_init_emulator(scp, "*"); @@ -2763,6 +2770,9 @@ sc->dev[0] =3D sc_alloc_tty(0, "ttyv%r", unit * MAXCONS); scp =3D alloc_scp(sc, sc->first_vty); SC_STAT(sc->dev[0]) =3D scp; + + /* move cursors to the initial positions */ + sc_sync_cursorpos(scp, col, row); } sc->cur_scp =3D scp; =20 --doUn1Hmx68n+7ij2-- --XCIqNWEteo88hZlY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmAyy8ACgkQ52SDGA2eCwX2NQCffmRxz+hf2OChXl3FSg/11/yF nhEAn0srAqJ7JGtKhaqxXyY8N4FylQ1p =6xjE -----END PGP SIGNATURE----- --XCIqNWEteo88hZlY--