From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JqPCg-0001oZ-5i for qemu-devel@nongnu.org; Mon, 28 Apr 2008 04:59:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JqPCb-0001nl-5Y for qemu-devel@nongnu.org; Mon, 28 Apr 2008 04:59:17 -0400 Received: from [199.232.76.173] (port=60446 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqPCa-0001nb-U3 for qemu-devel@nongnu.org; Mon, 28 Apr 2008 04:59:12 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JqPCa-0000BU-CU for qemu-devel@nongnu.org; Mon, 28 Apr 2008 04:59:12 -0400 Received: from samy by implementation.famille.thibault.fr with local (Exim 4.69) (envelope-from ) id 1JqPBr-0001O2-4E for qemu-devel@nongnu.org; Mon, 28 Apr 2008 10:58:27 +0200 Date: Mon, 28 Apr 2008 09:58:27 +0100 From: Samuel Thibault Subject: Re: [Qemu-devel] [PATCH] ncurses: resize console if required Message-ID: <20080428085827.GA4537@implementation.uk.xensource.com> References: <20080428035445.GA8787@tapir> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080428035445.GA8787@tapir> 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 Hello, Carlo Marcelo Arenas Belon, le Sun 27 Apr 2008 22:54:45 -0500, a écrit : > 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). > + /* check size of console and try to adjust if needed */ > + getmaxyx(stdscr, gheight, gwidth); > + if ((gwidth != 80) || (gheight != 25)) { > + printf("\033[8;25;80t"); > + } You can not just spit out escape sequences like this without know the kind of terminal you're in, you know :) At least check the TERM environment variable for those kind you know support it. Also, this should probably go inside the curses_resize() function, so that when the guest resizes to e.g. 80x50, the xterm window gets resized too. Samuel