[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ncurses: resize console if required

From: Samuel Thibault
Subject: Re: [Qemu-devel] [PATCH] ncurses: resize console if required
Date: Mon, 28 Apr 2008 09:58:27 +0100
User-agent: Mutt/1.5.12-2006-07-14


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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]