From 628c15a5b1f6f1db9f4534b609c3732b592b0536 Mon Sep 17 00:00:00 2001 From: Denis Burkov Date: Fri, 17 Jan 2025 23:06:11 +0500 Subject: [PATCH] shared/shell: add proper line clean to bt_shell_printf In some terminals (or all?) the line is not cleared before a new one is output (for example, if you turn on scanning and then try to write something to the terminal, the output will be mixed - you will get something like this: [JBL T450BT]# h[NEW] Device **** [JBL T450BT]# he[NEW] Device **** [JBL T450BT]# hell[NEW] Device **** [JBL T450BT]# hello[NEW] Device **** [JBL T450BT]# hello[NEW] Device **** Where "Device ****" is the line that was actually fed to bt_shell_printf. --- src/shared/shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/shell.c b/src/shared/shell.c index 37c747f8f..107fc7a76 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -719,6 +719,7 @@ void bt_shell_printf(const char *fmt, ...) saved_line = rl_copy_text(0, rl_end); if (!data.saved_prompt) rl_save_prompt(); + rl_clear_visible_line(); rl_reset_line_state(); } -- 2.47.3