From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HAsJs-0001Lj-TM for qemu-devel@nongnu.org; Sat, 27 Jan 2007 13:30:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HAsJr-0001KB-Bv for qemu-devel@nongnu.org; Sat, 27 Jan 2007 13:30:32 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HAsJr-0001K1-6U for qemu-devel@nongnu.org; Sat, 27 Jan 2007 13:30:31 -0500 Received: from moutng.kundenserver.de ([212.227.126.177]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HAsJq-0006Ny-NX for qemu-devel@nongnu.org; Sat, 27 Jan 2007 13:30:31 -0500 Message-ID: <45BB9A3E.4090404@mail.berlios.de> Date: Sat, 27 Jan 2007 19:30:22 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel][Patch] qemu console.c References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------090303010002010501010001" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------090303010002010501010001 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit > CVSROOT: /sources/qemu > Module name: qemu > Changes by: Thiemo Seufer 07/01/16 23:02:36 > > Modified files: > . : console.c > > Log message: > Improved console handling, thanks Stefan Weil. Here are two additional smaller changes for console.c. They fix cursor display at end of line and line wrapping. Please add them to CVS HEAD. Stefan --------------090303010002010501010001 Content-Type: text/plain; name="console.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="console.patch" Index: console.c =================================================================== RCS file: /sources/qemu/qemu/console.c,v retrieving revision 1.10 diff -u -b -B -w -u -r1.10 console.c --- console.c 16 Jan 2007 23:02:36 -0000 1.10 +++ console.c 27 Jan 2007 15:41:01 -0000 @@ -536,21 +536,24 @@ int y, y1; if (s == active_console) { + int x = s->x; + if (x >= s->width) { + x = s->width - 1; + } y1 = (s->y_base + s->y) % s->total_height; y = y1 - s->y_displayed; if (y < 0) y += s->total_height; if (y < s->height) { - c = &s->cells[y1 * s->width + s->x]; + c = &s->cells[y1 * s->width + x]; if (show) { TextAttributes t_attrib = s->t_attrib_default; t_attrib.invers = !(t_attrib.invers); /* invert fg and bg */ - vga_putcharxy(s->ds, s->x, y, c->ch, &t_attrib); + vga_putcharxy(s->ds, x, y, c->ch, &t_attrib); } else { - vga_putcharxy(s->ds, s->x, y, c->ch, - &(c->t_attrib)); + vga_putcharxy(s->ds, x, y, c->ch, &(c->t_attrib)); } - dpy_update(s->ds, s->x * FONT_WIDTH, y * FONT_HEIGHT, + dpy_update(s->ds, x * FONT_WIDTH, y * FONT_HEIGHT, FONT_WIDTH, FONT_HEIGHT); } } @@ -799,8 +802,10 @@ s->state = TTY_STATE_ESC; break; default: - if (s->x >= s->width - 1) { - break; + if (s->x >= s->width) { + /* line wrap */ + s->x = 0; + console_put_lf(s); } y1 = (s->y_base + s->y) % s->total_height; c = &s->cells[y1 * s->width + s->x]; @@ -808,12 +813,6 @@ c->t_attrib = s->t_attrib; update_xy(s, s->x, s->y); s->x++; -#if 0 /* line wrap disabled */ - if (s->x >= s->width) { - s->x = 0; - console_put_lf(s); - } -#endif break; } break; --------------090303010002010501010001--