Can not recognize the oh-my-posh configured in profile of powershell when open terminal via the start menu #20187

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

Originally created by @chucklu on GitHub (Jul 4, 2023).

Windows Terminal version

1.17.11461.0

Windows build number

10.0.19045.0

Other Software

oh-my-posh 17.6.0
configured the prompt as https://ohmyposh.dev/docs/installation/prompt

oh-my-posh init pwsh | Invoke-Expression

Steps to reproduce

1.configure the oh-my-posh in profile of powershell
2.search terminal in menu, find the windows terminal and choose powershell
image

Expected Behavior

should recognize the oh-my-posh correctly as I have configured it in PATH environment variable

Actual Behavior

got this The term 'oh-my-posh' is not recognized as a name of a cmdlet
image

However if I open the windows terminal via the context menu by right click inside the same folder, it works fine, it recognize the og-my-posh correctly.

Originally created by @chucklu on GitHub (Jul 4, 2023). ### Windows Terminal version 1.17.11461.0 ### Windows build number 10.0.19045.0 ### Other Software oh-my-posh 17.6.0 configured the prompt as https://ohmyposh.dev/docs/installation/prompt > oh-my-posh init pwsh | Invoke-Expression ### Steps to reproduce 1.configure the oh-my-posh in profile of powershell 2.search terminal in menu, find the windows terminal and choose powershell ![image](https://github.com/microsoft/terminal/assets/3004057/7a4d168e-c863-4a34-9111-db4946a0f40b) ### Expected Behavior should recognize the oh-my-posh correctly as I have configured it in PATH environment variable ### Actual Behavior got this `The term 'oh-my-posh' is not recognized as a name of a cmdlet` ![image](https://github.com/microsoft/terminal/assets/3004057/cd207f82-e514-46de-b403-b504190c8471) However if I open the windows terminal via the context menu by right click inside the same folder, it works fine, it recognize the og-my-posh correctly.
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 07:06:04 +00:00
Author
Owner

@lhecker commented on GitHub (Jul 5, 2023):

This seems similar to #15624.

@lhecker commented on GitHub (Jul 5, 2023): This seems similar to #15624.
Author
Owner

@chucklu commented on GitHub (Jul 5, 2023):

@lhecker Not sure, I tried to execute $env, I got nothing. But $env:Path shows the value of environment Path
also tried to update the profile to use .\oh-my-posh, just got the same error: The term '.\oh-my-posh' is not recognized as a name of a cmdlet, function, script file, or executable program.

@chucklu commented on GitHub (Jul 5, 2023): @lhecker Not sure, I tried to execute `$env`, I got nothing. But `$env:Path` shows the value of environment Path also tried to update the profile to use `.\oh-my-posh`, just got the same error: The term '.\oh-my-posh' is not recognized as a name of a cmdlet, function, script file, or executable program.
Author
Owner

@chucklu commented on GitHub (Jul 5, 2023):

@lhecker figured out, it seems I did not configured the environment Path correctly.
I should configure the oh-my-posh to the system variables Path instead of the user variables Path

@chucklu commented on GitHub (Jul 5, 2023): @lhecker figured out, it seems I did not configured the environment Path correctly. I should configure the oh-my-posh to the system variables Path instead of the user variables Path
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20187