[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] ui/console: add escape sequence \e[5, 6n
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v2] ui/console: add escape sequence \e[5, 6n |
Date: |
Tue, 08 Mar 2016 10:40:52 +0100 |
> +static void console_respond_str(QemuConsole *s, const char *buf)
> +{
> + TextCell *c;
> + int y1;
> + while (*buf) {
> + if (s->x >= s->width) {
> + s->x = 0;
> + console_put_lf(s);
> + }
> + y1 = (s->y_base + s->y) % s->total_height;
> + c = &s->cells[y1 * s->width + s->x];
> + c->ch = *buf;
> + c->t_attrib = s->t_attrib;
> + update_xy(s, s->x, s->y);
> + s->x++;
I think you should just call console_putchar() here instead of cut
+pasting that code block.
If that doesn't work for some reason move the code block to a new
function which can be called from both console_putchar() and
console_respond_str().
thanks,
Gerd