From 467a0297daa372e44f7108bdc0cb56399b87f59f Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 20 Feb 2018 12:09:40 +0100 Subject: [PATCH] shared/shell: Fix history display with no saved prompt Prompt needs to be restored always since default prompt is provided. This fix issues with history line being clobbered by offset of prompt length. [bluetooth]# connect 9C:5C:F9:AB:C5:82 Attempting to connect to 9C:5C:F9:AB:C5:82 [bluetooth]# disconnect 9C:5C:F9:AB:C5:82 Attempting to disconnect from 9C:5C:F9:AB:C5:82 Failed to connect: org.bluez.Error.Failed Successful disconnected [bluetooth]# discoverable on Changing discoverable on succeeded [CHG] Controller 5C:E0:C5:34:AE:1C Discoverable: yes [bluetooth]# disconnect discoverable on after pressing up-down [bluetooth]# disconnect dis5C:F9:AB:C5:82 Change-Id: I83d4d5e15cb67f51256359d7e73c19a840c85a34 Signed-off-by: Amit Purwar --- src/shared/shell.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shared/shell.c b/src/shared/shell.c index e7f17e0..6b81fd5 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -486,8 +486,7 @@ void bt_shell_printf(const char *fmt, ...) va_end(args); if (save_input) { - if (!data.saved_prompt) - rl_restore_prompt(); + rl_restore_prompt(); rl_replace_line(saved_line, 0); rl_point = saved_point; rl_forced_update_display(); -- 2.7.4