degesch: fix prompt not showing up after change
When a backlog helper was running and the prompt changed, it failed to restore within input_rl_show(). Since before input_rl_show() is called the prompt is empty and in input_rl__restore() it will be changed to the new version, just skip invoking any Readline functions within input_rl_set_prompt() when the prompt is hidden. Simple and straight-forward. This bug is what I hinted at in the previous commit.
This commit is contained in:
parent
572a7cb804
commit
d78cf10f04
|
@ -321,16 +321,14 @@ input_rl_set_prompt (void *input, char *prompt)
|
||||||
struct input_rl *self = input;
|
struct input_rl *self = input;
|
||||||
cstr_set (&self->prompt, prompt);
|
cstr_set (&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 ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue