diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2020-10-09 20:16:05 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2020-10-09 20:17:17 +0200 |
commit | b315892249c834654f5b80856a0e2e3b6dff5273 (patch) | |
tree | e2d14a43f2d77e7388e35bb45e0a87ac8f4cb1b4 | |
parent | 710f5f197fda31101e21bc349d6db0eb985b3bae (diff) | |
download | json-rpc-shell-b315892249c834654f5b80856a0e2e3b6dff5273.tar.gz json-rpc-shell-b315892249c834654f5b80856a0e2e3b6dff5273.tar.xz json-rpc-shell-b315892249c834654f5b80856a0e2e3b6dff5273.zip |
Readline: fix a dormant bug in prompt changes
For details, see a similar change in degesch from uirc3.
-rw-r--r-- | json-rpc-shell.c | 8 |
1 files 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 |