Open terminal via context menu doesn't pickup PATH variable #14352

Closed
opened 2026-01-31 04:07:58 +00:00 by claunia · 4 comments
Owner

Originally created by @chungweileong94 on GitHub (Jun 29, 2021).

Windows Terminal version (or Windows build number)

10.0.22000.0, 1.8.1521.0

Other Software

No response

Steps to reproduce

  • Open a target folder
  • Right-click and open "Windows Terminal"
  • Then run commands like yarn (the yarn is installed via npm i -g yarn)

Expected Behavior

It should able to run the yarn as the global node_modules is defined in PATH settings on Windows.

Actual Behavior

The terminal doesn't recognize the command.
image

However, it works fine if I open the Windows Terminal via the start menu, and navigate to the targeted folder

Originally created by @chungweileong94 on GitHub (Jun 29, 2021). ### Windows Terminal version (or Windows build number) 10.0.22000.0, 1.8.1521.0 ### Other Software _No response_ ### Steps to reproduce - Open a target folder - Right-click and open "Windows Terminal" - Then run commands like `yarn` (the `yarn` is installed via `npm i -g yarn`) ### Expected Behavior It should able to run the `yarn` as the global node_modules is defined in PATH settings on Windows. ### Actual Behavior The terminal doesn't recognize the command. ![image](https://user-images.githubusercontent.com/15154097/123735315-95ec7c00-d8d1-11eb-9bcf-a6530aee1bdc.png) However, it works fine if I open the Windows Terminal via the start menu, and navigate to the targeted folder
claunia added the Resolution-Duplicate label 2026-01-31 04:07:58 +00:00
Author
Owner

@DHowett commented on GitHub (Jun 29, 2021):

Terminal inherits the PATH from its parent process... which in the case of the shell extension should be Explorer. Hm.

@DHowett commented on GitHub (Jun 29, 2021): Terminal inherits the `PATH` from its parent process... which in the case of the shell extension should be Explorer. Hm.
Author
Owner

@chungweileong94 commented on GitHub (Jun 29, 2021):

After playing with the Windows 11 insider build, it did happen occasionally.

@chungweileong94 commented on GitHub (Jun 29, 2021): After playing with the Windows 11 insider build, it did happen occasionally.
Author
Owner

@DHowett commented on GitHub (Jul 8, 2021):

This will probably go away when we properly handle regenerating the environment block. We try to do it in Preview with mixed success. The stable builds don't do it, which causes the behavior you're seeing here.

We're tracking completion in /dup #1125.

@DHowett commented on GitHub (Jul 8, 2021): This will probably go away when we properly handle regenerating the environment block. We try to do it in Preview with mixed success. The stable builds don't do it, which causes the behavior you're seeing here. We're tracking completion in /dup #1125.
Author
Owner

@ghost commented on GitHub (Jul 8, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jul 8, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14352