Readline: fix a dormant bug in prompt changes

For details, see a similar change in degesch from uirc3.
This commit is contained in:
Přemysl Eric Janouch 2020-10-09 20:16:05 +02:00
parent 710f5f197f
commit b315892249
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -360,16 +360,14 @@ input_rl_set_prompt (struct input *input, char *prompt)
free (self->prompt); free (self->prompt);
self->prompt = prompt; self->prompt = prompt;
if (!self->active) if (!self->active || self->prompt_shown <= 0)
return; return;
// First reset the prompt to work around a bug in readline // First reset the prompt to work around a bug in readline
rl_set_prompt (""); rl_set_prompt ("");
if (self->prompt_shown > 0)
rl_redisplay (); rl_redisplay ();
rl_set_prompt (self->prompt); rl_set_prompt (self->prompt);
if (self->prompt_shown > 0)
rl_redisplay (); rl_redisplay ();
} }