The application variable rl_eof_found was not being reset in rl_initialize() when the RL_STATE_EOF flag was being cleared. Compare this to rl_done; this flag is reset at the same time that RL_STATE_DONE is cleared.
This was causing problem in GDB. If a user used EOF to quit from a prompt then the rl_eof_found flag would become "stuck" set to 1. After this, every time that an input line was completed and rl_deprep_terminal was called, an extra newline would be printed (when bracketed-paste-mode was on). Fix by resetting rl_eof_found. --- readline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/readline.c b/readline.c index d649af5..783b879 100644 --- a/readline.c +++ b/readline.c @@ -1206,6 +1206,7 @@ rl_initialize (void) /* We aren't done yet. We haven't even gotten started yet! */ rl_done = 0; + rl_eof_found = 0; RL_UNSETSTATE(RL_STATE_DONE|RL_STATE_TIMEOUT|RL_STATE_EOF); /* Tell the history routines what is going on. */ base-commit: 037d85f199a8c6e5b16689a46c8bc31b586a0c94 -- 2.25.4