Skip to content

Python REPL prompt garbled with shell integration escape sequences (]633;C...) in virtual environments on Ubuntu 24.04Β #25505

@bahiaxur

Description

@bahiaxur

Type: Bug

Behaviour

The Python REPL prompt is garbled and displays raw shell integration escape sequences instead of the clean prompt . The prompt looks like this:

]633;C]633;E;None]633;D;0]633;A>>> ]633;B

It happens whenever I open the Python REPL from a virtual environment. The prompt should be clean and display only the standard characters:

>>>

Disabling ms-python.python solves the problem, but I lose all the benefits of the extension.

Additional Context & Troubleshooting

  • The issue only occurs when a virtual environment is active. The system Python REPL displays the prompt correctly.
  • The problem is definitively caused by the ms-python.python extension, as confirmed using the Help: Start Extension Bisect command.
  • The problem disappears when running VS Code with a clean profile (code --user-data-dir /tmp/vscode-test --extensions-dir /tmp/vscode-test-extensions), confirming the issue lies within the user configuration state managed by the extension.
  • The following settings, which are intended to control this behavior, do not fix the issue, suggesting they are being ignored by the extension in this context:
    • "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"]
    • "python.terminal.activateEnvironment": false

Steps to reproduce:

  1. Install the latest stable versions of VS Code and the ms-python.python extension.
  2. Install uv and uv-virtualenvwrapper.
  3. Install python 3.8.20 (uv python install 3.8.20).
  4. Create a virtual enviroment (mkvirtualenv -p 3.8 my-env).
  5. Open VSCode. Open a new terminal (Terminal -> New Terminal).
  6. Switch to my-env (workon my-env). Open python repl.

Diagnostic data

Extension version: 2025.14.0
VS Code version: Code 1.104.2 (e3a5acfb517a443235981655413d566533107e92, 2025-09-24T11:21:37.073Z)
OS version: Linux x64 6.14.0-33-generic
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.3
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
  • Value of the python.languageServer setting: Default
User Settings

Multiroot scenario, following user settings may not apply:

languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
aws-toolkit-vscode ama 3.78.0
copilot Git 1.372.0
copilot-chat Git 0.31.4
dark-autumn-frost fim 1.1.2
debugpy ms- 2025.10.0
docker doc 0.17.0
EditorConfig Edi 0.17.4
emr-tools Ama 0.7.0
gc-excelviewer Gra 4.2.64
github-vscode-theme Git 6.3.5
intellicode-api-usage-examples Vis 0.2.9
isort ms- 2025.0.0
js-debug ms- 1.104.0
js-debug-companion ms- 1.1.3
jupyter ms- 2025.8.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.0
mhtml2md dev 1.0.2
nightowl-theme Anc 0.10.9
python ms- 2025.14.0
rainbow-bracket tal 1.0.2
remote-containers ms- 0.427.0
Theme-Monokai-Midnight ger 0.0.5
unified-glow-vscode-theme Ikr 1.0.2
vscode-containers ms- 2.2.0
vscode-docker ms- 2.0.0
vscode-edit-csv jan 0.11.7
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-pylance ms- 2025.8.3
vscode-python-envs ms- 1.8.0
vscode-yaml red 1.19.0
vscodeintellicode Vis 1.3.2
System Info
Item Value
CPUs AMD Ryzen 7 7735HS with Radeon Graphics (16 x 3069)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 1, 1, 1
Memory (System) 30.12GB (21.91GB free)
Process Argv --crash-reporter-id 5ce291ce-de6b-4aa9-b3a2-7660754e02d2
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE wayland
A/B Experiments
vsliv368:30146709
vswsl492:30256859
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
usemplatestapi:31297334
aj953862:31281341
cs4_fixed:31391938
b6b4d950:31327385
nes-set-on:31351930
6abeh943:31336334
0cj2b977:31352657
gendocstringt:31395207
0574c672:31362109
cloudbuttont:31379625
todos-1:31390405
multireplacestringcontrol:31393296
treatment_gpt5applypatchexclusively:31394181
3efgi100_wstrepl:31382709
trigger-command-fix:31379601
auto_model_enabled:31385282
use-responses-api:31390855
gemagent1cf:31396483
dcggh915:31397497

Metadata

Metadata

Assignees

Labels

triage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions