bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bracketed paste mode prints newline on EOF


From: Leah Neukirchen
Subject: Bracketed paste mode prints newline on EOF
Date: Tue, 04 Jan 2022 12:10:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

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  <leah@vuxu.org>  https://leahneukirchen.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]