Hi,

I first thought I found a bug in rlwrap[1], but we traced it down to
readline.  When "enable-bracketed-paste" is on (default as of 8.1),
an empty line is printed when readline() gets EOF.

[1]: https://github.com/hanslub42/rlwrap/issues/144

To reproduce:

% cat readline.c                       
#include <stdio.h>
#include <readline/readline.h>
int main(int argc, char** argv) {
        readline("");
}

% gcc -o readline readline.c -lreadline
% echo 'set enable-bracketed-paste off' >paste-off
% echo 'set enable-bracketed-paste on' >paste-on

% INPUTRC=paste-off ./readline
[press ^D, program terminates without any output]
% INPUTRC=paste-on ./readline 
[press ^D, program prints empty line]

This seems to be caused by the escape-sequence to turn off the paste
mode again.

Thanks,
-- 
Leah Neukirchen  <[email protected]>  https://leahneukirchen.org/

Reply via email to