diff options
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-05 23:01:47 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-05 23:01:47 +0000
commit2724b1806a63d66148cea62e1fe1cae3b417bc7e (patch)
tree4358154ee5b4d54dd14fbcd9a70a63a25e5defab /readline.c
parentmonitor: Decouple terminals (Jan Kiszka) (diff)
monitor: Improve mux'ed console experience (Jan Kiszka)
Up to now, you never really knew if you already switched the console after pressing CTRL-A C or if you mistyped it again. This patch clarifies the situation by providing a prompt in a new line and injecting a linebreak when switching away again. For this purpose, the two events CHR_EVENT_MUX_IN and CHR_EVENT_MUX_OUT are introduced and distributed on focus switches. Signed-off-by: Jan Kiszka <> Signed-off-by: Anthony Liguori <> git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'readline.c')
1 files changed, 5 insertions, 0 deletions
diff --git a/readline.c b/readline.c
index 1868b1082..9c4b68b53 100644
--- a/readline.c
+++ b/readline.c
@@ -444,6 +444,11 @@ void readline_start(ReadLineState *rs, const char *prompt, int read_password,
rs->readline_func = readline_func;
rs->readline_opaque = opaque;
rs->read_password = read_password;
+ readline_restart(rs);
+void readline_restart(ReadLineState *rs)
rs->cmd_buf_index = 0;
rs->cmd_buf_size = 0;