From ebe4530c4ad2cd485a19796583ac5a33031f6b1e Mon Sep 17 00:00:00 2001 From: iBug Date: Sat, 11 Oct 2025 15:00:36 +0800 Subject: [PATCH] Fix microsoft/vscode#232420: Python REPL cursor drifting --- python_files/pythonrc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_files/pythonrc.py b/python_files/pythonrc.py index 005b06bcdd15..63c52bc009da 100644 --- a/python_files/pythonrc.py +++ b/python_files/pythonrc.py @@ -52,7 +52,9 @@ def __str__(self): result = "" # For non-windows allow recent_command history. if sys.platform != "win32": - result = "{command_executed}{command_line}{command_finished}{prompt_started}{prompt}{command_start}".format( + result = "{soh}{command_executed}{command_line}{command_finished}{prompt_started}{stx}{prompt}{soh}{command_start}{stx}".format( + soh="\001", + stx="\002", command_executed="\x1b]633;C\x07", command_line="\x1b]633;E;" + str(get_last_command()) + "\x07", command_finished="\x1b]633;D;" + str(exit_code) + "\x07",