qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hani Benhabiles <kroosec@gmail.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, qemu-trivial@nongnu.org,
	lcapitulino@redhat.com, stefanha@redhat.com,
	xiawenc@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH] readline: Clear screen on form feed.
Date: Sun,  1 Jun 2014 12:53:35 +0100	[thread overview]
Message-ID: <1401623615-7548-1-git-send-email-kroosec@gmail.com> (raw)

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");
+    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';
-- 
1.8.3.2

             reply	other threads:[~2014-06-01 11:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-01 11:53 Hani Benhabiles [this message]
2014-06-02 12:20 ` [Qemu-devel] [PATCH] readline: Clear screen on form feed 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
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=1401623615-7548-1-git-send-email-kroosec@gmail.com \
    --to=kroosec@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@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 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).