From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Paris Subject: [PATCH] qemu: reset more state after CR/LF Date: Mon, 13 Aug 2007 10:19:33 -0400 Message-ID: <1187014773813-git-send-email-jim@jtan.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Jim Paris To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org After receiving CR or LF on the monitor, reset term_last_cmd_* as well. This matches the setup that is done by term_show_prompt(), and is for the case when readline_start() is not called before the next readline_handle_byte(). Without this, unnecessary terminal escape sequences will be printed by term_update() before the next prompt. Signed-off-by: Jim Paris --- Avi, this goes along with 076e405adda6b47563e23ac24b57c8bb8ba55488, "qemu: reset buffer pointers after CR/LF", which wasn't quite complete. Thanks. qemu/readline.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu/readline.c b/qemu/readline.c index bde3342..0a02b08 100644 --- a/qemu/readline.c +++ b/qemu/readline.c @@ -337,6 +337,8 @@ void readline_handle_byte(int ch) term_printf("\n"); term_cmd_buf_index = 0; term_cmd_buf_size = 0; + term_last_cmd_buf_index = 0; + term_last_cmd_buf_size = 0; /* NOTE: readline_start can be called here */ term_readline_func(term_readline_opaque, term_cmd_buf); break; -- 1.5.3.rc4 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/