Do not exit readline prompt early if it's in a subcommand of some sort

This commit is contained in:
Andrzej Rybczak
2017-03-24 05:07:14 +01:00
parent c3b996c0e8
commit f1d9c24938

View File

@@ -54,7 +54,10 @@ int read_key(FILE *)
x = w->getX();
if (w->runPromptHook(rl_line_buffer, &done))
{
if (done)
// Do not end if readline is in one of its commands, e.g. searching
// through history, as it doesn't actually make readline exit and it
// becomes stuck in a loop.
if (!RL_ISSTATE(RL_STATE_DISPATCHING) && done)
{
rl_done = 1;
return EOF;