You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pasting multi-line clipboard contents into urwid, the newline symbols (\n) get reported as enter key presses.
Most terminal emulators now support the bracketed paste mode, which should allow urwid to distinguish between the Enter key presses and newlines in pasted text.
An example of the kind of behavior that is expected: pasting the above multi-line contents into bash (with set enable-bracketed-paste on in ~/.inputrc) keeps the newline:
$ Ab
Cd
In sh (dash) the newline gets interpreted as Enter (same as in urwid currently):
$ Ab
Cd
sh: 49: Ab: not found
$ sh: 50: Cd: not found
$
exquo
changed the title
Pasting clipboard, newlines are interpreted as Enter key presses
Bracketed paste mode support
Jan 13, 2021
Description:
When pasting multi-line clipboard contents into urwid, the newline symbols (
\n
) get reported asenter
key presses.Most terminal emulators now support the bracketed paste mode, which should allow urwid to distinguish between the Enter key presses and newlines in pasted text.
Affected versions
master
branch (4c739b6be21b0c98324e7b7780d8e712f3ad6db3
)pypi
(2.1.2
)Steps to reproduce
(same idea: can use the Global Input example in urwid tutorial, or run
input_test.py
fromexamples
)Pasting (with e.g.
Shift + Insert
) into the terminal window where urwid is running a multi-line clipboard contents:The output is
Expected/actual outcome
Expected: pasted newline symbols are interpreted as
\n
"keys".Actual: pasted newline symbols are interpreted as
enter
keys.Related
Support bracketed paste mode escape sequences #119
The text was updated successfully, but these errors were encountered: