STINNER Victor <vstin...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue42819>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to