From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuMHo-00078l-BJ for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:40:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuMHf-0007Ry-T3 for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:40:24 -0400 Date: Tue, 10 Jun 2014 09:40:10 -0400 From: Luiz Capitulino Message-ID: <20140610094010.01354730@redhat.com> In-Reply-To: <1401623615-7548-1-git-send-email-kroosec@gmail.com> References: <1401623615-7548-1-git-send-email-kroosec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] readline: Clear screen on form feed. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hani Benhabiles Cc: kwolf@redhat.com, qemu-trivial@nongnu.org, qemu-devel@nongnu.org, stefanha@redhat.com, xiawenc@linux.vnet.ibm.com On Sun, 1 Jun 2014 12:53:35 +0100 Hani Benhabiles wrote: > Signed-off-by: Hani Benhabiles Applied to the qmp branch, thanks. Btw, we don't add a period to the end of the first line in the changelog. > --- > 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';