[issue42819] readline 8.1 bracketed paste

STINNER Victor report at bugs.python.org
Mon Feb 15 05:07:56 EST 2021


STINNER Victor <vstinner at python.org> added the comment:

https://lists.gnu.org/archive/html/bug-readline/2020-11/msg00010.html
says that bracketed mode is turned off if the terminal type is "dumb".

Setting TERM env var to dumb gives me a surprising behavior when I paste "1+1\n2+2" in Python REPL:
---
$ TERM=dumb python3
Python 3.9.1 (default, Jan 20 2021, 00:00:00) 
>>> ^J1+1^J2+2^J
---

If I press ENTER, I get:
---
>>> ^J1+1^J2+2^J
  File "<stdin>", line 1
    
1+1
2+2

    ^
SyntaxError: multiple statements found while compiling a single statement
>>> 
---

Note: if I redirect Python output into a file ("python3 > output"), I get a different behavior since stdout is no longer a TTY.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42819>
_______________________________________


More information about the Python-bugs-list mailing list