aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Paris <jim@jtan.com>2007-08-13 10:19:33 -0400
committerAvi Kivity <avi@qumranet.com>2007-08-13 19:08:54 +0300
commit28315e7565dc43a4c05b022fa94e199d3aaf22a4 (patch)
tree79068bc90e23fb76b57871f83004d3cdf1aaf2b4
parentf2028c521cad8b9e37f1113127fc16e2dee884ee (diff)
qemu: reset more state after CR/LF
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 <jim@jtan.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--readline.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/readline.c b/readline.c
index bde33422b..0a02b08b4 100644
--- a/readline.c
+++ b/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;