Skip to content

Activated VirtualEnvs Are Ignored When Launching from CLI with Workspace File #25140

Open
@tgrue-openai

Description

@tgrue-openai

Type: Bug

Behaviour

We launch code in a python virtual env as such:

code ~/dev/workspace_files/infra-common.code-workspace

When we do, code doesn't pick up the activated virtualenv. This feature is supported, but there is an early exit check which documents an assumption that CLI launches and workspace files are not used together.

As such, vscode is started with an incorrect virtualenv (which is sticky if the user ever manually selected one). This has created meaningful confusion for our org and we haven't found a workaround.

Steps to reproduce:

  1. Launch vscode with a code workspace file in an activated python virtual env.

Not seen:

VS Code was launched from an activated environment: 'infra-common', selecting it as the interpreter for workspace.

Extension version: 2025.6.1
VS Code version: Code 1.100.3 (Universal) (258e40fedc6cb8edf399a463ce3a9d32e7e1f6f3, 2025-06-02T13:30:54.273Z)
OS version: Darwin arm64 24.5.0
Modes:

System Info
Item Value
CPUs Apple M3 Max (16 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 29, 12, 12
Memory (System) 48.00GB (0.08GB free)
Process Argv . --enable-proposed-api openai.scientist-assistant-vscode-ext --crash-reporter-id 2497da2a-6cf4-4072-b445-311818f85ee4
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551:31249599
vscod805:30301674
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
pythonrstrctxt:31112756
nativeloc2:31192216
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
996jf627:31283433
pythonrdcb7:31303018
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
pylancecolor:31314202
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
gendocf:31295004
pylancequickfixf:31319675

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bugneeds PRReady to be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions