All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] readline: Clear screen on form feed.
@ 2014-06-01 11:53 Hani Benhabiles
  2014-06-02 12:20 ` Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Hani Benhabiles @ 2014-06-01 11:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, qemu-trivial, lcapitulino, stefanha, xiawenc

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-10 13:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2014-06-10 13:40 ` Luiz Capitulino

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.