From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JqKAL-0006Qg-VG for qemu-devel@nongnu.org; Sun, 27 Apr 2008 23:36:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JqKA2-0006KT-UQ for qemu-devel@nongnu.org; Sun, 27 Apr 2008 23:36:33 -0400 Received: from [199.232.76.173] (port=47295 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqKA2-0006KL-Ng for qemu-devel@nongnu.org; Sun, 27 Apr 2008 23:36:14 -0400 Received: from tapir.sajinet.com.pe ([66.139.79.212]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JqKA1-00062O-R0 for qemu-devel@nongnu.org; Sun, 27 Apr 2008 23:36:14 -0400 Date: Sun, 27 Apr 2008 22:54:45 -0500 From: Carlo Marcelo Arenas Belon Message-ID: <20080428035445.GA8787@tapir> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] ncurses: resize console if required 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 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). 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); }