From 61e8a640b1e5881ccca40b38f14627d878b7ac5c Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Wed, 8 Apr 2020 16:14:07 -0700 Subject: [PATCH] client: Rewrite workaround for readline Instead of calling display(""), explicitly use the sequence of commands to force readline to properly update its internal state and re-display the prompt. --- client/display.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/display.c b/client/display.c index 4bcf51a2..cf74326d 100644 --- a/client/display.c +++ b/client/display.c @@ -534,7 +534,14 @@ void display_enable_cmd_prompt(void) rl_set_prompt(IWD_PROMPT); - display(""); + /* + * The following sequence of rl_* commands forces readline to properly + * update its internal state and re-display the new prompt. + */ + rl_save_prompt(); + rl_redisplay(); + rl_restore_prompt(); + rl_forced_update_display(); } void display_disable_cmd_prompt(void)