You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening a terminal, the Python virtualenv activation command (e..g source /path/to/.venv/bin/activate) is issued too late. Most of the time, I’ve already started typing another command before activation occurs. As a result, the activation command is appended to whatever I was typing, and the combined text is executed as-is. This causes the virtualenv activation to fail, and the command I was entering is also lost.
This seems potentially dangerous, because it can result in excuting commands I never intended to run. For example, if I type rm and the activation triggers right after, the executed command becomes: rm source /path/to/.venv/bin/activate. This would obviously delete the listed paths.
This appears to be the same issue described in the now-closed #15719 (2021). That issue includes a video that already demonstrates the problem well, so I haven’t recorded a new one. Here's the video from the old issue:
Peek.19-03-2021.07-50.mp4
The problem seems to be shell-agnostic: I can reproduce it in both Bash and Fish. It’s also not caused by my custom shell configuration, since it still happens when running Bash with --noprofile --norc.
Steps to reproduce:
Open a new internal terminal (panel or editor area)
Start typing a command immediately
Notice that your input is appended with the virtualenv command and executed together
Diagnostic data
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2025-09-04 13:19:15.065 [info] > pyenv which python
2025-09-04 13:19:15.066 [info] cwd: .
2025-09-04 13:19:28.051 [info] Active interpreter [/home/ige/repos/pythontest]: /home/ige/repos/pythontest/.venv/bin/python
2025-09-04 13:19:30.733 [info] Starting Pylance language server.
2025-09-04 13:19:37.000 [info] Send text to terminal: source /home/ige/repos/pythontest/.venv/bin/activate
Extension version: 2025.12.0
VS Code version: Code 1.103.1 (360a4e4fd251bfce169a4ddf857c7d25d1ad40da, 2025-08-12T16:25:40.542Z)
OS version: Linux x64 6.15.9-201.fc42.x86_64+debug
Modes:
Remote OS version: Linux x64 6.15.9-201.fc42.x86_64+debug
Python version: 3.13.3
Type of virtual environment used: venv
Value of the python.languageServer setting: Default
Type: Bug
Behaviour
When opening a terminal, the Python virtualenv activation command (e..g
source /path/to/.venv/bin/activate) is issued too late. Most of the time, I’ve already started typing another command before activation occurs. As a result, the activation command is appended to whatever I was typing, and the combined text is executed as-is. This causes the virtualenv activation to fail, and the command I was entering is also lost.This seems potentially dangerous, because it can result in excuting commands I never intended to run. For example, if I type
rmand the activation triggers right after, the executed command becomes:rm source /path/to/.venv/bin/activate. This would obviously delete the listed paths.This appears to be the same issue described in the now-closed #15719 (2021). That issue includes a video that already demonstrates the problem well, so I haven’t recorded a new one. Here's the video from the old issue:
Peek.19-03-2021.07-50.mp4
The problem seems to be shell-agnostic: I can reproduce it in both Bash and Fish. It’s also not caused by my custom shell configuration, since it still happens when running Bash with
--noprofile --norc.Steps to reproduce:
Diagnostic data
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)Extension version: 2025.12.0
VS Code version: Code 1.103.1 (360a4e4fd251bfce169a4ddf857c7d25d1ad40da, 2025-08-12T16:25:40.542Z)
OS version: Linux x64 6.15.9-201.fc42.x86_64+debug
Modes:
Remote OS version: Linux x64 6.15.9-201.fc42.x86_64+debug
python.languageServersetting: DefaultUser Settings
Installed Extensions
System Info
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
A/B Experiments