From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JqWto-0006C8-Mq for qemu-devel@nongnu.org; Mon, 28 Apr 2008 13:12:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JqWtm-0006BG-Uc for qemu-devel@nongnu.org; Mon, 28 Apr 2008 13:12:20 -0400 Received: from [199.232.76.173] (port=59531 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqWtm-0006Aw-Ez for qemu-devel@nongnu.org; Mon, 28 Apr 2008 13:12:18 -0400 Received: from tapir.sajinet.com.pe ([66.139.79.212]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JqWtm-0006AQ-65 for qemu-devel@nongnu.org; Mon, 28 Apr 2008 13:12:18 -0400 Date: Mon, 28 Apr 2008 12:31:13 -0500 From: Carlo Marcelo Arenas Belon Subject: Re: [Qemu-devel] [PATCH] ncurses: resize console if required Message-ID: <20080428173113.GB8787@tapir> References: <20080428035445.GA8787@tapir> <20080428101415.GD16597@networkno.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080428101415.GD16597@networkno.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thiemo Seufer Cc: qemu-devel@nongnu.org On Mon, Apr 28, 2008 at 11:14:15AM +0100, Thiemo Seufer wrote: > Carlo Marcelo Arenas Belon wrote: > > The following patch instructs qemu to print an escape command to resize the > > curses console to 80x25 if detected to have a different geometry (xterm and > > friends use 80x24 by default). > > Sounds like this should be specific to the PC/VGA emulation. not sure what you mean, but the curses.c emulation assumes (and is hardcoded) to a 80x25 console anyway. this patch only checks the window size of the console that is being used and sends it an escape command to change its size to what the curses console will use so that they match; otherwise if starting qemu from an 80x24 xterm with -curses you won't be able to see the last line of the console until the window is resized. Carlo > > --- > > Index: curses.c > > =================================================================== > > --- curses.c (revision 4274) > > +++ curses.c (working copy) > > @@ -367,6 +367,11 @@ > > > > invalidate = 1; > > > > + /* check size of console and try to adjust if needed */ > > + getmaxyx(stdscr, gheight, gwidth); > > + if ((gwidth != 80) || (gheight != 25)) { > > + printf("\033[8;25;80t"); > > + } > > /* Standard VGA initial text mode dimensions */ > > curses_resize(ds, 80, 25); > > } > >