aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-06 13:37:07 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-06 13:42:27 +0200
commitd78cf10f04723b513e8b7b065a878643de777ed8 (patch)
tree9e1e92a5518be5362af2c509682740a01d101936
parent572a7cb8044c896f6c3701e188ca38e3807da064 (diff)
downloadxK-d78cf10f04723b513e8b7b065a878643de777ed8.tar.gz
xK-d78cf10f04723b513e8b7b065a878643de777ed8.tar.xz
xK-d78cf10f04723b513e8b7b065a878643de777ed8.zip
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.
-rw-r--r--degesch.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/degesch.c b/degesch.c
index 8cba5da..d3e31a8 100644
--- a/degesch.c
+++ b/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