All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Hani Benhabiles <kroosec@gmail.com>
Cc: kwolf@redhat.com, qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	Markus Armbruster <armbru@redhat.com>,
	stefanha@redhat.com, xiawenc@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH] readline: Clear screen on form feed.
Date: Mon, 9 Jun 2014 16:32:32 -0400	[thread overview]
Message-ID: <20140609163232.5d0fc6ed@redhat.com> (raw)
In-Reply-To: <1401623615-7548-1-git-send-email-kroosec@gmail.com>

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?

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

  parent reply	other threads:[~2014-06-09 20:32 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 ` Luiz Capitulino [this message]
2014-06-09 23:00   ` [Qemu-devel] " Hani Benhabiles
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=20140609163232.5d0fc6ed@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kroosec@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xiawenc@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.