Open japageth opened 1 month ago
The code you show looks fine to me. Is this what you see in 3.13? Please copy and paste the full traceback or message.
The bug can be reproduced, here is a screenshot
Duplicate https://github.com/python/cpython/issues/122237 PR https://github.com/python/cpython/pull/122383
Thank you for the additional clear info. Closing as duplicate.
Duplicate #122237 PR #122383
This is not a duplicate. It's a Windows-specific issue that WinAPI requires a console application to set their input handle with ENABLE_VIRTUAL_TERMINAL_INPUT
flag before it can be talked in VT escaped sequences. The flag isn't set in windows_console.py
, so it's impossible to have bracketed-paste wrapping sequences sent to PYREPL.
Even if it is set, the default Windows command prompt, at least on 21H2 LTSC, does not support bracketed-paste. A modern terminal emulator like your Windows Terminal is required for this feature. We need to figure out a way to make an educated guess at user's terminal and turn off the autoindentation if necessary.
PYREPL is atm only scanning virtual key codes under Windows, once the console is configured as a virtual terminal, all the keys will be sent in VT sequences.
PR: #124119
oh, you are right @terryjreedy We need reopen this
Bug report
Bug description:
I use Python downloaded from python.org without using a graphical environment such as IPython. Instead, I use the Windows Terminal with the REPL built into python.exe. In 3.12.6, I can paste a function definition copied from a text editor directly into the REPL and everything works fine. In 3.13.rc2 this does not work; the indentation is all messed up and I get an IndentationError.
CPython versions tested on:
3.12, 3.13
Operating systems tested on:
Windows
Linked PRs