Description
Bug report
Bug description:
Bug Report
Related: #122622
Bug description:
VS Code has set of custom escape sequences that allow shell integration.
We have a custom pythonrc file that we set equal to user's PYTHONSTARTUP file and effectively override user's sys.ps1(this can be improved once we have the pre-exec hook mentioned in the related PR) This allows us to get features that VS Code shell integration offers.
With the new REPL that 3.13 offers, we have noticed that the cursor location is wrongly placed whenever REPL from Python3.13 is launched from our terminal. See:
After investigation we found out it is because Python3.13 is somehow handling our custom sequences such as
command_line="\x1b]633;E;" + str(get_last_command()) + "\x07",
instead of ignoring them as it did in the previous versions of Python. This is what is leads to the wrong cursor location at the end. Removing these sequences brought back the cursor to the "right" position in terminal.
CPython should ignore these custom sequences instead of wrongly handling them.
Edit: Workaround could be temporarily disabling PyREPL via env var injection
exporting PYTHON_BASIC_REPL=1
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Linked PR
coming soon (would appreciate advice on where to start digging in but I assume it is somewhere https://github.com/python/cpython/tree/main/Lib/_pyrepl)