qemu console.c
CVSROOT: /sources/qemu
Module name: qemu
Changes by: Thiemo Seufer <ths> 07/01/16 23:02:36
Modified files:
. : console.c
Log message:
Improved console handling, thanks Stefan Weil.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/console.c?cvsroot=qemu&r1=1.9&r2=1.10
Quoted 10 lines
CVSROOT: /sources/qemu
Module name: qemu
Changes by: Thiemo Seufer <ths> 07/01/16 23:02:36Modified files:
. :console.cLog message:
Improved console handling, thanks Stefan Weil.
Here are two additional smaller changes for console.c. They fix cursor display at end of line and line wrapping.
Please add them to CVS HEAD.
Stefan
Index: console.c
===================================================================
RCS file: /sources/qemu/qemu/console.c,v
retrieving revision 1.10
console.c +12 -13
@@ -536,21 +536,24 @@int y, y1;if (s == active_console) { +int x = s->x; +if (x >= s->width) { + x = s->width -1 ; + } y1 = (s->y_base + s->y) % s->total_height; y = y1 - s->y_displayed;if (y <0 ) y += s->total_height;if (y < s->height) { - c = &s->cells[y1 * s->width + s->x]; + c = &s->cells[y1 * s->width + x];if (show) {TextAttributes t_attrib = s->t_attrib_default; t_attrib.invers = !(t_attrib.invers);/* invert fg and bg */ -vga_putcharxy (s->ds, s->x, y, c->ch, &t_attrib); +vga_putcharxy (s->ds, x, y, c->ch, &t_attrib); }else { -vga_putcharxy (s->ds, s->x, y, c->ch, - &(c->t_attrib)); +vga_putcharxy (s->ds, x, y, c->ch, &(c->t_attrib)); } -dpy_update (s->ds, s->x *FONT_WIDTH , y *FONT_HEIGHT , +dpy_update (s->ds, x *FONT_WIDTH , y *FONT_HEIGHT ,FONT_WIDTH ,FONT_HEIGHT ); } }
@@ -799,8 +802,10 @@ s->state =TTY_STATE_ESC ;break ;default : -if (s->x >= s->width -1 ) { -break ; +if (s->x >= s->width) { +/* line wrap */ + s->x =0 ; +console_put_lf (s); } y1 = (s->y_base + s->y) % s->total_height; c = &s->cells[y1 * s->width + s->x];
@@ -808,12 +813,6 @@ c->t_attrib = s->t_attrib;update_xy (s, s->x, s->y); s->x++; -#if 0 /* line wrap disabled */ -if (s->x >= s->width) { - s->x =0 ; -console_put_lf (s); - } -#endif break ; }break ;
Quoted 8 lines · Stefan Weil
Quoted 8 lines
CVSROOT: /sources/qemu
Module name: qemu
Changes by: Thiemo Seufer <ths> 07/01/16 23:02:36Modified files:
. :console.c
Quoted 6 lines
Quoted 2 lines
Log message:
Improved console handling, thanks Stefan Weil.Here are two additional smaller changes for
console.c. They fix cursor display at end of line and line wrapping.Please add them to CVS HEAD.
Something isn't ok with it. Try running e.g. mutt in a emulated Linux system, it appears garbled.
Thiemo
Quoted 10 lines · Thiemo Seufer
Quoted 9 lines · Stefan Weil
Quoted 9 lines
CVSROOT: /sources/qemu
Module name: qemu
Changes by: Thiemo Seufer <ths> 07/01/16 23:02:36Modified files:
. :console.cLog message:
Improved console handling, thanks Stefan Weil.
Quoted 8 lines
Quoted 4 lines
Here are two additional smaller changes for
console.c. They fix cursor display at end of line and line wrapping.Please add them to CVS HEAD.
Something isn't ok with it. Try running e.g. mutt in a emulated Linux system, it appears garbled.
Thiemo
I tried. These are my results:
Mutt does not work with ANSI escape sequences.
It needs VT100 emulation or better. Try
TERM=ansi mutt
in any terminal (xterm, Linux VGA text console, ...) - you will get the same garbled output, so QEMU is compatible :-)
My patch improves QEMU's ANSI emulation
(so please add it to CVS HEAD), but it does not add VT100 capabilities.
Stefan