[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 10/19] monitor: Break out readline_show_prompt
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH v2 10/19] monitor: Break out readline_show_prompt |
Date: |
Sat, 21 Feb 2009 19:29:16 +0100 |
User-agent: |
StGIT/0.14.2 |
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 <address@hidden>
---
console.h | 1 +
monitor.c | 2 ++
readline.c | 14 ++++----------
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/console.h b/console.h
index 1402067..dc80755 100644
--- a/console.h
+++ b/console.h
@@ -319,5 +319,6 @@ void readline_find_completion(const char *cmdline);
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
diff --git a/monitor.c b/monitor.c
index c5234ba..de5205e 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2824,6 +2824,7 @@ void monitor_resume(void)
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)
@@ -2882,6 +2883,7 @@ static void monitor_readline(const char *prompt, int
is_password,
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;
diff --git a/readline.c b/readline.c
index 8572841..5a089be 100644
--- a/readline.c
+++ b/readline.c
@@ -57,7 +57,7 @@ static int term_is_password;
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 @@ static void term_show_prompt2(void)
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 @@ static void term_completion(void)
j = 0;
}
}
- term_show_prompt2();
+ readline_show_prompt();
}
}
@@ -473,7 +466,8 @@ void readline_start(const char *prompt, int is_password,
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)
- [Qemu-devel] [PATCH v2 01/19] char: Fix initial reset, (continued)
- [Qemu-devel] [PATCH v2 01/19] char: Fix initial reset, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 03/19] block: Polish error handling of brdv_open2, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 05/19] block: Introduce bdrv_get_encrypted_filename, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 09/19] monitor: Simplify password input mode, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 08/19] monitor: Rework early disk password inquiry, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 07/19] monitor: Report encrypted disks in snapshot mode, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 14/19] monitor: Drop banner hiding, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 11/19] monitor: Rework modal password input, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 19/19] monitor: Pass-through for gdbstub, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 13/19] monitor: Rework terminal management, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 10/19] monitor: Break out readline_show_prompt,
Jan Kiszka <=
- [Qemu-devel] [PATCH v2 16/19] monitor: Decouple terminals, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 18/19] monitor: Introduce MONITOR_USE_READLINE flag, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 15/19] monitor: Introduce ReadLineState, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 12/19] monitor: Rework API, Jan Kiszka, 2009/02/21
- [Qemu-devel] [PATCH v2 17/19] monitor: Improve mux'ed console experience, Jan Kiszka, 2009/02/21
- Re: [Qemu-devel] [PATCH v2 00/19] monitor rework, Anthony Liguori, 2009/02/27