Skip to content

VS Code new python extension will break python new repl #138979

@yihong0618

Description

@yihong0618

now in VS Code with latest python extension we can not
go to the new repl....

see the png

Image

and it seems use the ms VS Code Python...

➜ cpython git:(main) ./python.exe
Python 3.15.0a0 (heads/main:3e06cfcaee, Sep 16 2025, 20:15:43) [Clang 17.0.0 (clang-1700.0.13.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Cmd click to launch VS Code Native REPL

breakpoint()
(1)()
(Pdb) n
--Return--
(1)()->None
(Pdb) n
--Call--
/Users/yihong/Library/Application Support/Code/User/workspaceStorage/27f79048bd19b5492140f86c94b13ec5/ms-python.python/pythonrc.py(48)str()
-> def str(self):
(Pdb) ll
48 -> def str(self):
49 exit_code = int(bool(self.hooks.failure_flag))
50 self.hooks.failure_flag = False
51 # Guide following official VS Code doc for shell integration sequence:
52 result = ""
53 # For non-windows allow recent_command history.
54 if sys.platform != "win32":
55 result = "{command_executed}{command_line}{command_finished}{prompt_started}{prompt}{command_start}".format(
56 command_executed="\x1b]633;C\x07",
57 command_line="\x1b]633;E;" + str(get_last_command()) + "\x07",
58 command_finished="\x1b]633;D;" + str(exit_code) + "\x07",
59 prompt_started="\x1b]633;A\x07",
60 prompt=original_ps1,
61 command_start="\x1b]633;B\x07",
62 )
63 else:
64 result = "{command_finished}{prompt_started}{prompt}{command_start}{command_executed}".format(
65 command_finished="\x1b]633;D;" + str(exit_code) + "\x07",
66 prompt_started="\x1b]633;A\x07",
67 prompt=original_ps1,
68 command_start="\x1b]633;B\x07",
69 command_executed="\x1b]633;C\x07",
70 )
71
72 # result = f"{chr(27)}]633;D;{exit_code}{chr(7)}{chr(27)}]633;A{chr(7)}{original_ps1}{chr(27)}]633;B{chr(7)}{chr(27)}]633;C{chr(7)}"
73
74 return result
(Pdb)

uninstall VS Code Python extension it goes into normal


test main and python3.14 and python3.13

and this is my python extension version
I am not quite sure when it break the new repl

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions