From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adE8S-0004vQ-Qm for qemu-devel@nongnu.org; Tue, 08 Mar 2016 04:41:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adE8O-0002rQ-NK for qemu-devel@nongnu.org; Tue, 08 Mar 2016 04:41:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adE8O-0002rM-I7 for qemu-devel@nongnu.org; Tue, 08 Mar 2016 04:40:56 -0500 Message-ID: <1457430052.22567.53.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 08 Mar 2016 10:40:52 +0100 In-Reply-To: <1457260617-12996-1-git-send-email-rkx1209dev@gmail.com> References: <1457260617-12996-1-git-send-email-rkx1209dev@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2] ui/console: add escape sequence \e[5, 6n List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ren Kimura Cc: qemu-devel@nongnu.org > +static void console_respond_str(QemuConsole *s, const char *buf) > +{ > + TextCell *c; > + int y1; > + while (*buf) { > + if (s->x >=3D s->width) { > + s->x =3D 0; > + console_put_lf(s); > + } > + y1 =3D (s->y_base + s->y) % s->total_height; > + c =3D &s->cells[y1 * s->width + s->x]; > + c->ch =3D *buf; > + c->t_attrib =3D 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