From f5f9b4a94fefd204ffa437f21d7ae381cb776d40 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 13 Apr 2018 17:42:40 +0300 Subject: [PATCH] shared/shell: Fix artifacts related to prompt Both bt_shell_prompt_input and bt_shell_input could cause the prompt to be printed incorrectly, so they now rely on bt_shell_printf which properly check if input and prompt shall be saved/restored. Change-Id: Idf305cd6c29515aaca28a240103d5b08bfe3dc52 Signed-off-by: Amit Purwar --- src/shared/shell.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/shell.c b/src/shared/shell.c index 6b81fd5..e7f17e0 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -486,7 +486,8 @@ void bt_shell_printf(const char *fmt, ...) va_end(args); if (save_input) { - rl_restore_prompt(); + if (!data.saved_prompt) + rl_restore_prompt(); rl_replace_line(saved_line, 0); rl_point = saved_point; rl_forced_update_display(); -- 2.7.4