Browse Source

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.
master
Přemysl Eric Janouch 2 years ago
parent
commit
d78cf10f04
Signed by: p
GPG Key ID: A0420B94F92B9493
  1. 8
      degesch.c

8
degesch.c

@ -321,17 +321,15 @@ input_rl_set_prompt (void *input, char *prompt)
struct input_rl *self = input;
cstr_set (&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 void

Loading…
Cancel
Save