4 ms·
> Note the newline character gets appended to the end of the line. As others have already pointed out, an API for interacting with the clipboard is a terrible
by pdkl95 10y ago
> Note the newline character gets appended to the end of the line.
As others have already pointed out, an API for interacting with the clipboard is a terrible idea that should be removed from the browser.
However, this particular problem of pasting multi-line strings into the terminal is already a solved problem if you use rxvt-unicode. The standard package includes the perl plugin "confirm-paste"[1][2]. Enable it in ~/.Xresources
URxvt.perl-ext-common: default,confirm-paste
confirm-paste passes single line pastes normally, but asks for a y/n confirmation before sending a multi-line paste to the shell.
[1] urxvt-confirm-paste(1)
[2] http://cvs.schmorp.de/rxvt-unicode/src/perl/confirm-paste?view=markup http://cvs.schmorp.de/rxvt-unicode/src/perl/confirm-paste?vi...