From: Hani Benhabiles <kroosec@gmail.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: qemu-trivial@nongnu.org, mjt@tls.msk.ru, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] readline: Clear screen on form feed.
Date: Tue, 10 Jun 2014 00:00:10 +0100 [thread overview]
Message-ID: <20140609230010.GA22765@Inspiron-3521> (raw)
In-Reply-To: <20140609163232.5d0fc6ed@redhat.com>
On Mon, Jun 09, 2014 at 04:32:32PM -0400, Luiz Capitulino wrote:
> On Sun, 1 Jun 2014 12:53:35 +0100
> Hani Benhabiles <kroosec@gmail.com> wrote:
>
> > Signed-off-by: Hani Benhabiles <hani@linux.com>
> > ---
> > util/readline.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/util/readline.c b/util/readline.c
> > index 8baec55..08d07e3 100644
> > --- a/util/readline.c
> > +++ b/util/readline.c
> > @@ -345,6 +345,12 @@ static void readline_completion(ReadLineState *rs)
> > }
> > }
> >
> > +static void readline_clear_screen(ReadLineState *rs)
> > +{
> > + rs->printf_func(rs->opaque, "\033[2J\033[1;1H");
>
> That's a smart way of doing it and I can't suggest anything better. But
> what happens on Windows?
Sorry, I have no experience with Windows and I can't give a definite answer about it.
But as Michael pointed out, readline is already using similar escape sequences.
>
> > + readline_show_prompt(rs);
> > +}
> > +
> > /* return true if command handled */
> > void readline_handle_byte(ReadLineState *rs, int ch)
> > {
> > @@ -363,6 +369,9 @@ void readline_handle_byte(ReadLineState *rs, int ch)
> > case 9:
> > readline_completion(rs);
> > break;
> > + case 12:
> > + readline_clear_screen(rs);
> > + break;
> > case 10:
> > case 13:
> > rs->cmd_buf[rs->cmd_buf_size] = '\0';
>
next prev parent reply other threads:[~2014-06-09 23:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-01 11:53 [Qemu-devel] [PATCH] readline: Clear screen on form feed Hani Benhabiles
2014-06-02 12:20 ` Stefan Hajnoczi
2014-06-02 21:49 ` Hani Benhabiles
2014-06-08 14:03 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-06-09 20:32 ` [Qemu-devel] " Luiz Capitulino
2014-06-09 23:00 ` Hani Benhabiles [this message]
2014-06-10 13:40 ` Luiz Capitulino
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=20140609230010.GA22765@Inspiron-3521 \
--to=kroosec@gmail.com \
--cc=lcapitulino@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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).