Skip to content

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

Closed as duplicate

Description

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

Activity

  1. bltravis commented on Oct 8, 2025

    @bltravis

    Glad(?) I'm not the only one seeing this.

  2. SolalAttiasInstadeep commented on Oct 8, 2025

    @SolalAttiasInstadeep

    Disabling the Preview setting "Python › Terminal › Shell Integration: Enabled" (python.terminal.shellIntegration.enabled) fixed this for me.

    Hope this helps!

  3. bahiaxur commented on Oct 15, 2025

    @bahiaxur
    Author

    Disabling the Preview setting "Python › Terminal › Shell Integration: Enabled" (python.terminal.shellIntegration.enabled) fixed this for me.

    That worked for me. Thanks! I don't know what features I'll lose by disabling this, but at least those characters are not appearing anymore.

  4. davidwyld commented on Oct 22, 2025

    @davidwyld

    Disabling the Preview setting "Python › Terminal › Shell Integration: Enabled" (python.terminal.shellIntegration.enabled) fixed this for me.

    That worked for me. Thanks! I don't know what features I'll lose by disabling this, but at least those characters are not appearing anymore.

    This setting seems to control the ability to launch a REPL integrated into VS code, which itself seems to work. With the setting python.terminal.shellIntegration.enabled on, you get the "Ctrl click to launch VS Code Native REPL" in the Python shell, which opens the integrated REPL.

    Python 3.13.3 (main, Apr  9 2025, 04:03:52) [Clang 20.1.0 ] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    Ctrl click to launch VS Code Native REPL
    ]633;C]633;E;None]633;D;0]633;A>>> ]633;B
    
  5. eburnette commented on Dec 9, 2025

    @eburnette

    I am seeing these escape characters on Red Hat Enterprise Linux release 8.6 (Ootpa). Disabling python.terminal.shellIntegration.enabled cleared it up but I'd like to have shell integration.

  6. cj81499 commented on Dec 10, 2025

    @cj81499

    Seems related to/duplicate of #25467

  7. anthonykim1 commented on Dec 11, 2025

    @anthonykim1

    /duplicate #25467

  8. added
    bugIssue identified by VS Code Team member as probable bug
    *duplicateIssue identified as a duplicate of another issue(s)
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicateIssue identified as a duplicate of another issue(s)area-terminalbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions