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
Windows environment variables are supposed to be case-insensitive; however, if VS Code is launched from a shell where the Path variable is PATH instead of Path (such as one created by Python), Code's environment will create a second Path variable instead of inheriting PATH from the parent shell.
Steps:
Create a shell that uses PATH instead of Path. The simplest way I found is to just create a shell from python:
# make_shell.pyimportosimportsubprocesscommand= ["cmd", "/Q", "/K"]
print("Path is now PATH")
subprocess.call(command, shell=True, env=os.environ)
> python make_shell.py
Path is now PATH
> |
Launch VS Code from this new shell
Check your environment variables in the terminal
cmd: set path will show both PATH and Path -- modifications to PATH made upstream are not be reflected on Path
pwsh: trying to use dir env: will throw an error. Using write-host $env:path will show Path, and any changes to PATH upstream will be lost
Same effect occurs on Insider build. I don't know when exactly this behavior changed, but pre-configured shells are a pretty big piece of some developer tools we use
VS Code version: Code 1.97.2 (e54c774, 2025-02-12T23:20:35.343Z)
OS version: Windows_NT x64 10.0.26100
Modes:
@Tyriar -- Thanks for looking into this! I use Python to create a cmd session, then launch Code from that session -- it's only in the VS Code terminal that you can see the duplicated path variable.
This is an even easier way to demonstrate, you can launch Code directly from python without making a new interactive session:
# launch_code.pyimportosimportsubprocessprint("Path is now PATH")
subprocess.call(["code", "--new-window"], shell=True, env=os.environ)
Tried with terminal.integrated.experimental.windowsUseConptyDll - no change.
Type: Bug
Windows environment variables are supposed to be case-insensitive; however, if VS Code is launched from a shell where the Path variable is
PATH
instead ofPath
(such as one created by Python), Code's environment will create a secondPath
variable instead of inheritingPATH
from the parent shell.Steps:
PATH
instead ofPath
. The simplest way I found is to just create a shell from python:Launch VS Code from this new shell
Check your environment variables in the terminal
cmd:
set path
will show bothPATH
andPath
-- modifications toPATH
made upstream are not be reflected onPath
pwsh: trying to use
dir env:
will throw an error. Usingwrite-host $env:path
will showPath
, and any changes toPATH
upstream will be lostSame effect occurs on Insider build. I don't know when exactly this behavior changed, but pre-configured shells are a pretty big piece of some developer tools we use
VS Code version: Code 1.97.2 (e54c774, 2025-02-12T23:20:35.343Z)
OS version: Windows_NT x64 10.0.26100
Modes:
System Info
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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
The text was updated successfully, but these errors were encountered: