From b315892249c834654f5b80856a0e2e3b6dff5273 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Fri, 9 Oct 2020 20:16:05 +0200 Subject: Readline: fix a dormant bug in prompt changes For details, see a similar change in degesch from uirc3. --- json-rpc-shell.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/json-rpc-shell.c b/json-rpc-shell.c index 94baaf9..7e7be25 100644 --- a/json-rpc-shell.c +++ b/json-rpc-shell.c @@ -360,17 +360,15 @@ input_rl_set_prompt (struct input *input, char *prompt) free (self->prompt); self->prompt = prompt; - if (!self->active) + if (!self->active || self->prompt_shown <= 0) return; // First reset the prompt to work around a bug in readline rl_set_prompt (""); - if (self->prompt_shown > 0) - rl_redisplay (); + rl_redisplay (); rl_set_prompt (self->prompt); - if (self->prompt_shown > 0) - rl_redisplay (); + rl_redisplay (); } static bool -- cgit v1.2.3-70-g09d2