VisualStudioCodeForCommandPalette icon indicating copy to clipboard operation
VisualStudioCodeForCommandPalette copied to clipboard

PATH not up to date when starting VSCode

Open nWestie opened this issue 1 year ago • 5 comments

If this would be better reported up to the Command Palette repo, let me know.

When PATH is updated by an app (ex: I installed node), the PATH variable used by spawned apps is not updated until Command Palette is restarted.

Chain of events:

  • Install node using winget in built-in terminal in VSCode
    • node/npm cannot be run, command not found.
  • Close VSCode, restart workspace from Command Palette
    • still not finding extension
  • Confirm that node runs in a separate, fresh terminal
  • Exit Command Palette and restart it
    • node can be called from VSCode terminal as expected

Not sure if this is something that can be fixed on the extension level, or if it's an issue with Command Palette generally. I don't remember this happening with Powertoys Run, but can't say for sure (it's not something that comes up often)

nWestie avatar Sep 29 '25 20:09 nWestie

I’m not familiar with this issue, and from the description it sounds like the behavior might be unrelated to this extension. It may be something at the Command Palette level rather than something we can address here.

tanchekwei avatar Sep 30 '25 12:09 tanchekwei

Ran into this today and cost me a ton of time to troubleshoot. This affects all envvars, not just PATH. The root cause is that the vscode process when run through this plugin is under a long tree of processes started before you do any environment variable changes (I recommend using sysinternals procmon to see that for yourself). I won't be using this extension anymore, this is unacceptable.

PawelAdamczuk avatar Feb 06 '26 08:02 PawelAdamczuk

see https://github.com/microsoft/PowerToys/issues/42306

tanchekwei avatar Mar 09 '26 09:03 tanchekwei

I'll close this then - that seems to confirm it is an issue at the Command Palette level.

nWestie avatar Mar 09 '26 16:03 nWestie

Revisited and fixed this issue.

Visual Studio Code

  • If this is the first VS Code instance, environment variables are inherited from the parent process.
  • If this is not the first VS Code instance, environment variables are inherited from the already running VS Code instance.

Visual Studio

  • The PATH updates without requiring all Visual Studio instances to be closed.

tanchekwei avatar Nov 08 '26 06:11 tanchekwei