From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LfMYz-0008JQ-4M for qemu-devel@nongnu.org; Thu, 05 Mar 2009 18:01:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LfMYy-0008JE-GE for qemu-devel@nongnu.org; Thu, 05 Mar 2009 18:01:12 -0500 Received: from [199.232.76.173] (port=43416 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LfMYy-0008JB-Bg for qemu-devel@nongnu.org; Thu, 05 Mar 2009 18:01:12 -0500 Received: from savannah.gnu.org ([199.232.41.3]:59809 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LfMYx-0005b9-Uf for qemu-devel@nongnu.org; Thu, 05 Mar 2009 18:01:12 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LfMYx-0001RQ-7J for qemu-devel@nongnu.org; Thu, 05 Mar 2009 23:01:11 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LfMYw-0001Qq-So for qemu-devel@nongnu.org; Thu, 05 Mar 2009 23:01:11 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Thu, 05 Mar 2009 23:01:10 +0000 Subject: [Qemu-devel] [6709] monitor: Break out readline_show_prompt (Jan Kiszka) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6709 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6709 Author: aliguori Date: 2009-03-05 23:01:10 +0000 (Thu, 05 Mar 2009) Log Message: ----------- monitor: Break out readline_show_prompt (Jan Kiszka) Break readline_show_prompt out of readline_start so that (re-)printing the prompt can be controlled in a more fine-grained way. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/console.h trunk/monitor.c trunk/readline.c Modified: trunk/console.h =================================================================== --- trunk/console.h 2009-03-05 23:01:05 UTC (rev 6708) +++ trunk/console.h 2009-03-05 23:01:10 UTC (rev 6709) @@ -316,5 +316,6 @@ const char *readline_get_history(unsigned int index); void readline_start(const char *prompt, int is_password, ReadLineFunc *readline_func, void *opaque); +void readline_show_prompt(void); #endif Modified: trunk/monitor.c =================================================================== --- trunk/monitor.c 2009-03-05 23:01:05 UTC (rev 6708) +++ trunk/monitor.c 2009-03-05 23:01:10 UTC (rev 6709) @@ -2855,6 +2855,7 @@ static void monitor_start_input(void) { readline_start("(qemu) ", 0, monitor_handle_command1, NULL); + readline_show_prompt(); } static void term_event(void *opaque, int event) @@ -2913,6 +2914,7 @@ char *buf, int buf_size) { readline_start(prompt, is_password, monitor_readline_cb, NULL); + readline_show_prompt(); monitor_readline_buf = buf; monitor_readline_buf_size = buf_size; monitor_readline_started = 1; Modified: trunk/readline.c =================================================================== --- trunk/readline.c 2009-03-05 23:01:05 UTC (rev 6708) +++ trunk/readline.c 2009-03-05 23:01:10 UTC (rev 6709) @@ -57,7 +57,7 @@ static char term_prompt[256]; static void *term_readline_opaque; -static void term_show_prompt2(void) +void readline_show_prompt(void) { term_printf("%s", term_prompt); term_flush(); @@ -66,13 +66,6 @@ term_esc_state = IS_NORM; } -static void term_show_prompt(void) -{ - term_show_prompt2(); - term_cmd_buf_index = 0; - term_cmd_buf_size = 0; -} - /* update the displayed command line */ static void term_update(void) { @@ -360,7 +353,7 @@ j = 0; } } - term_show_prompt2(); + readline_show_prompt(); } } @@ -473,7 +466,8 @@ term_readline_func = readline_func; term_readline_opaque = opaque; term_is_password = is_password; - term_show_prompt(); + term_cmd_buf_index = 0; + term_cmd_buf_size = 0; } const char *readline_get_history(unsigned int index)