[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/53352: libedit no longer displaying prompt
>Synopsis: libedit no longer displaying prompt
>Arrival-Date: Thu Jun 07 18:30:00 +0000 2018
>Originator: Reiner Herrmann
ported libedit on Linux
Since libedit/readline.c [v1.145] the prompt is no longer shown after the first finished line, when using rl_callback_handler_install + rl_callback_read_char in an event loop.
The following program demonstrates the problem.
When entering several lines, the prompt is not displayed after the lines have been handled.
void readline_handler(char *input)
printf("entered string: %s\n", input);
rl_callback_handler_install("> ", readline_handler);
if (select(1, &rfds, NULL, NULL, NULL) > 0)
Reverting the mentioned commit fixes it for me.
I think the problem is that it checks for rl_already_prompted, which is never set back to 0 after the first input line.
I'm not completely sure what the commit intended to fix, but if rl_already_prompted is changed back to 0 before the callback is called, this would still allow interpreters etc. to set it to 1 if they handle prompts themselves, while keeping the old behavior for the other cases.
Main Index |
Thread Index |