Skip to content

On Windows, the integrated PowerShell terminal gets a PATH with broken vscode CLI when started using Code.exe #302026

@mpapirkovskyy

Description

@mpapirkovskyy

Type: Bug

Observed behavior:

  • If VS Code is fully closed and then launched from the Start menu (or directly via Code.exe), the integrated PowerShell terminal resolves code to Code.exe instead of bin\code.cmd.
  • In this state, commands like code --version open a new VS Code window instead of behaving like the CLI.
  • If VS Code is fully closed and then launched from code.cmd from a terminal, the integrated PowerShell terminal PATH is correct and code resolves to ...\Microsoft VS Code\bin\code.cmd.
  • After launching once via code.cmd, opening additional VS Code windows keeps the good behavior.

Steps to Reproduce:

  1. Fully exit all VS Code windows/processes.
  2. Launch VS Code from Start menu (or directly from C:\Users\<user>\AppData\Local\Programs\Microsoft VS Code\Code.exe).
  3. Open a new integrated PowerShell terminal.
  4. Run:
    Get-Command code -All
  5. Observe that code resolves to ...\Microsoft VS Code\Code.exe before ...\Microsoft VS Code\bin\code.cmd.
  6. Optionally run code --version and observe that it opens a new VS Code window instead of printing version info.

Control case:

  1. Fully exit all VS Code windows/processes.
  2. Launch VS Code from terminal via code.cmd / code ..
  3. Open a new integrated PowerShell terminal.
  4. Run:
    Get-Command code -All
  5. Observe that code resolves correctly to ...\Microsoft VS Code\bin\code.cmd.

Expected:
The integrated terminal should get consistent PATH / command resolution regardless of whether VS Code was launched from Start menu / Code.exe or from code.cmd.

Actual:
The integrated terminal inherits or constructs a different PATH depending on launch method, causing code to resolve to Code.exe in one case and code.cmd in the other.

VS Code version: Code 1.111.0 (ce099c1, 2026-03-06T23:06:10Z)
OS version: Windows_NT x64 10.0.26200
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz (20 x 3600)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x2705 [NVIDIA GeForce RTX 4070 Ti SUPER], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.15.9144 ACTIVE
GPU1: VENDOR= 0x8086, DEVICE=0x9bc5 [Intel(R) UHD Graphics 630], DRIVER_VERSION=31.0.101.2111
GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.7309
Machine model name:
Machine model version:
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: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 63.85GB (25.92GB free)
Process Argv --crash-reporter-id d5268291-c5d9-48b9-bc4d-ec80f13f4317
Screen Reader no
VM 0%
Extensions (22)
Extension Author (truncated) Version
docker doc 0.18.0
copilot-chat Git 0.39.1
vscode-github-actions git 0.31.0
lyrebird-language-extension lyr 4.6.4
vscode-containers ms- 2.4.1
vscode-docker ms- 2.0.0
csdevkit ms- 2.10.3
csharp ms- 2.120.3
vscode-dotnet-runtime ms- 3.0.0
debugpy ms- 2025.18.0
python ms- 2026.4.0
vscode-pylance ms- 2026.1.1
vscode-python-envs ms- 1.22.0
remote-containers ms- 0.447.0
remote-wsl ms- 0.104.3
cmake-tools ms- 1.22.28
cpp-devtools ms- 0.3.6
cpptools ms- 1.30.5
cpptools-extension-pack ms- 1.5.1
vscode-xml red 0.29.0
vscode-taskexplorer spm 3.0.11
code-spell-checker str 4.5.6

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
pythonvspyt551:31249599
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
6abeh943:31336334
envsactivate1:31464700
cloudbuttont:31379625
aihoversummaries_f:31469309
42190218_ostrepl:31403339
839jf696:31457053
use-responses-api:31390855
ddidtcf:31399634
je187915:31401257
ec5jj548:31422691
cp_cls_t_966_ss:31454198
4je02754:31466945
ge8j1254_inline_auto_hint_haiku:31431912
nes-autoexp-off:31446584
7a04d226_do_not_restore_last_panel_session:31438103
cp_cls_c_1081:31454833
ia-use-proxy-models-svc:31452481
a43f0574a:31442826
e9c30283:31461165
test_treatment2:31471001
nes-conv-2-3:31474331
subagent_3ccgc321:31467997
idci7584:31464702
edit_mode_hidden:31461530
864ei723_large_tool_results_to_disk:31460878
notips:31471632
55364912:31471672
nes-extended-on:31455476
chat:31457767
0h66b693:31473807
nes-rcnt-ctrl:31471618
8a2c4887_5_3_codex_prompt:31475326
cpptoolsoff-v2:31475362
f0268191:31471593
editor1:31474144
thinking_c:31471065
db0gd219:31473911
newsessionicon:31473927
h08i8180_copy:31475368
nes-notsn-1:31475122

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginstall-updateVS Code installation and upgrade system issuesverifiedVerification succeededwindowsVS Code on Windows issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions