Skip to contentSkip to conversation

qemu: reset more state after CR/LF

PATCH Applied Jim Paris 2 participants 2 messages Aug 13, 2007 1 message not in the archive KVM

lore
Share & tools
lore

Jim Paris

author
#0 lore raw

PATCH 1/1 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.

---

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(-)
qemu/readline.c +2 -0
index bde3342..0a02b08 100644
@@ -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;
Signature · 8 lines
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/

A message that is not in the archive (sent off-list or not yet received): 1187014773813-git-send-email-jim-XrPbb/[email protected]

Applied
#2 lore raw
Quoted 7 lines · Jim Paris

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.

Applied, thanks. Please submit to qemu-devel as well.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
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/