qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Ren Kimura <rkx1209dev@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] ui/console: add escape sequence \e[5, 6n
Date: Tue, 08 Mar 2016 10:40:52 +0100	[thread overview]
Message-ID: <1457430052.22567.53.camel@redhat.com> (raw)
In-Reply-To: <1457260617-12996-1-git-send-email-rkx1209dev@gmail.com>

> +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

  reply	other threads:[~2016-03-08  9:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06 10:36 [Qemu-devel] [PATCH v2] ui/console: add escape sequence \e[5,6n Ren Kimura
2016-03-08  9:40 ` Gerd Hoffmann [this message]
2016-03-08 10:05   ` [Qemu-devel] [PATCH v2] ui/console: add escape sequence \e[5, 6n Ren Kimura

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457430052.22567.53.camel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkx1209dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).