* [Qemu-devel] [PATCH 0/1][RESEND] v2: Fix monitor console in curses mode
@ 2008-09-04 16:10 Ryan Harper
2008-09-04 16:10 ` [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses Ryan Harper
0 siblings, 1 reply; 5+ messages in thread
From: Ryan Harper @ 2008-09-04 16:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Ryan Harper, kvm, Ian Kirk
No futher feedback or concerns received, please apply.
v2: dropped initial display size changes in curses.c -- not needed.
The current curses code doesn't adjust the curses and text console display to
match the size of the terminal and fails to adjust properly after a resize.
The attach patches ensure that text_console_resize events adjust the
Textconsole display area so they stay the same size as the curses display.
The result is that we no longer see broken output like:
QEMU 0.9.1 monitor - type 'help' for more information
(qemu)
(qemu)
(qemu)
and you can resize your terminal window and the monitor and serial text consoles
adjust properly as well.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses
2008-09-04 16:10 [Qemu-devel] [PATCH 0/1][RESEND] v2: Fix monitor console in curses mode Ryan Harper
@ 2008-09-04 16:10 ` Ryan Harper
2008-09-15 16:48 ` andrzej zaborowski
0 siblings, 1 reply; 5+ messages in thread
From: Ryan Harper @ 2008-09-04 16:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Ryan Harper, kvm, Ian Kirk
v2: drop initial size adjustment, not needed.
Resize events fail to ensure that both the text console and curses display areas
are the same size; this causes broken output like:
QEMU 0.9.1 monitor - type 'help' for more information
(qemu)
(qemu)
(qemu)
To fix this, ensure that the display width and the text area width are sync for
text consoles on refresh; also force a resize event whenever we invalidate the
text console.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
diff --git a/console.c b/console.c
index 1c94980..89bdc52 100644
--- a/console.c
+++ b/console.c
@@ -608,6 +608,9 @@ static void console_refresh(TextConsole *s)
s->text_y[0] = 0;
s->text_x[1] = s->width - 1;
s->text_y[1] = s->height - 1;
+ /* ensure that textconsole area is the same size as the display */
+ s->g_width = s->ds->width;
+ s->g_height = s->ds->height;
s->cursor_invalidate = 1;
return;
}
@@ -1158,6 +1161,8 @@ static void text_console_invalidate(void *opaque)
TextConsole *s = (TextConsole *) opaque;
console_refresh(s);
+ /* resize if needed */
+ text_console_resize(s);
}
static void text_console_update(void *opaque, console_ch_t *chardata)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses
2008-09-04 16:10 ` [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses Ryan Harper
@ 2008-09-15 16:48 ` andrzej zaborowski
2008-09-15 17:35 ` Ryan Harper
0 siblings, 1 reply; 5+ messages in thread
From: andrzej zaborowski @ 2008-09-15 16:48 UTC (permalink / raw)
To: qemu-devel; +Cc: Ryan Harper, Paul Brook, kvm, Ian Kirk
Hi,
2008/9/4 Ryan Harper <ryanh@us.ibm.com>:
> v2: drop initial size adjustment, not needed.
>
> Resize events fail to ensure that both the text console and curses display areas
> are the same size; this causes broken output like:
It seems that this was broken by r4812. Your patch looks correct but
I think it will prevent things like -serial vc:80Cx24C from working as
documented. There's a conflict here: either virtual consoles have
commandline-set fixed size or they adjust to the window size like
before r4812 and don't have parts that don't fit on the screen. The
SDL window is not resizable but the curses window is always resizable.
I propose to add TEXT_CONSOLE_FIXED_SIZE back, it was removed by
r4812. I will do this unless there are better ideas.
Another idea would be to set the default console size to 640x400 and
agree to not support terminals < 80x24.
Regards
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses
2008-09-15 16:48 ` andrzej zaborowski
@ 2008-09-15 17:35 ` Ryan Harper
2008-09-15 18:42 ` andrzej zaborowski
0 siblings, 1 reply; 5+ messages in thread
From: Ryan Harper @ 2008-09-15 17:35 UTC (permalink / raw)
To: andrzej zaborowski; +Cc: Paul Brook, Ryan Harper, qemu-devel, kvm, Ian Kirk
* andrzej zaborowski <balrogg@gmail.com> [2008-09-15 11:51]:
> Hi,
Hello,
>
> 2008/9/4 Ryan Harper <ryanh@us.ibm.com>:
> > v2: drop initial size adjustment, not needed.
> >
> > Resize events fail to ensure that both the text console and curses display areas
> > are the same size; this causes broken output like:
>
> It seems that this was broken by r4812. Your patch looks correct but
Thanks for taking a look,
> I think it will prevent things like -serial vc:80Cx24C from working as
> documented. There's a conflict here: either virtual consoles have
> commandline-set fixed size or they adjust to the window size like
> before r4812 and don't have parts that don't fit on the screen. The
> SDL window is not resizable but the curses window is always resizable.
> I propose to add TEXT_CONSOLE_FIXED_SIZE back, it was removed by
> r4812. I will do this unless there are better ideas.
I'll test the -serial to see if that breaks with the current patch..
I'm also looking at an alternative. I think that in curses.c if on
window change event we can send a qemu_console_resize() to the text
consoles with the new width,height, that does the work of getting the
width/height in sync. I'll send an update if I get that working.
>
> Another idea would be to set the default console size to 640x400 and
> agree to not support terminals < 80x24.
I'm not sure that would fix it completely, I'm pretty sure the output
still looks broken even if your terminal is bigger than the min size
required.
>
> Regards
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253 T/L: 678-9253
ryanh@us.ibm.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses
2008-09-15 17:35 ` Ryan Harper
@ 2008-09-15 18:42 ` andrzej zaborowski
0 siblings, 0 replies; 5+ messages in thread
From: andrzej zaborowski @ 2008-09-15 18:42 UTC (permalink / raw)
To: Ryan Harper; +Cc: Paul Brook, qemu-devel, kvm, Ian Kirk
2008/9/15 Ryan Harper <ryanh@us.ibm.com>:
> * andrzej zaborowski <balrogg@gmail.com> [2008-09-15 11:51]:
>> Hi,
>
> Hello,
>
>>
>> 2008/9/4 Ryan Harper <ryanh@us.ibm.com>:
>> > v2: drop initial size adjustment, not needed.
>> >
>> > Resize events fail to ensure that both the text console and curses display areas
>> > are the same size; this causes broken output like:
>>
>> It seems that this was broken by r4812. Your patch looks correct but
>
> Thanks for taking a look,
>
>> I think it will prevent things like -serial vc:80Cx24C from working as
>> documented. There's a conflict here: either virtual consoles have
>> commandline-set fixed size or they adjust to the window size like
>> before r4812 and don't have parts that don't fit on the screen. The
>> SDL window is not resizable but the curses window is always resizable.
>> I propose to add TEXT_CONSOLE_FIXED_SIZE back, it was removed by
>> r4812. I will do this unless there are better ideas.
>
> I'll test the -serial to see if that breaks with the current patch..
> I'm also looking at an alternative. I think that in curses.c if on
> window change event we can send a qemu_console_resize() to the text
> consoles with the new width,height, that does the work of getting the
> width/height in sync. I'll send an update if I get that working.
The TEXT_CONSOLE_FIXED_SIZE approach worked ok, too, and it's generic
(i.e. if in sdl.c you make the SDL window resizable then it'll start
working for SDL automatically).
>
>>
>> Another idea would be to set the default console size to 640x400 and
>> agree to not support terminals < 80x24.
>
> I'm not sure that would fix it completely, I'm pretty sure the output
> still looks broken even if your terminal is bigger than the min size
> required.
Right, at the moment it is broken because curses.c assumes that text
consoles automatically resized to ds->width,ds->height and they
didn't, they keep the size given through vc:XxY or 800x600 if none was
given.
Regards
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-15 18:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-04 16:10 [Qemu-devel] [PATCH 0/1][RESEND] v2: Fix monitor console in curses mode Ryan Harper
2008-09-04 16:10 ` [Qemu-devel] [PATCH 1/1][RESEND] v2: Fix text console size/resize when using curses Ryan Harper
2008-09-15 16:48 ` andrzej zaborowski
2008-09-15 17:35 ` Ryan Harper
2008-09-15 18:42 ` andrzej zaborowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).