Closed Rafi-99 closed 2 years ago
@Rafi-99 how did you install oh-my-posh? Because if you want it to be available, it needs to be in your PATH
.
@JanDeDobbeleer Oh wow! Thank you for replying so fast!
At first, I installed it using PowerShell. Then I ended up installing it using chocolatey. I believe I have 2 installations of oh-my-posh on my machine since I got confused.
How do I add it to my path correctly?
@Rafi-99 I suggest to install using Winget or scoop. That's official and will also add it to PATH. You can follow the guide for Windows here, that also contains all you need to know for CMD. First, uninstall the current ones so there's no conflicts possible.
@JanDeDobbeleer Alright, thank you so much! I will let you know how it goes.
@JanDeDobbeleer I installed it using Winget as you suggested. Got it working in Powershell natively. Windows Terminal profiles for Powershell and Git Bash work. However, the original issue of the native Git Bash and VSCode integrated terminal is still not working.
Could you guide me to where I should look next?
The only thing I can think off is either the Profile which is different on vscode and/or the PATH that doesn't contain the right entry for oh-my-posh.
@JanDeDobbeleer Okay, thanks. For the native Git Bash issue, do you suggest looking at the PATH as well?
I do have oh-my-posh in my PATH correctly I think. The scope is user and not system though
Lastly, I have this in my .bashrc
eval "$(oh-my-posh --init --shell bash --config ~/microverse-power.omp.json)"
Appreciate any help you can provide.
Never mind, I believe I have fixed the issue. The issue was with Git Bash not finding the required variables in my path at all. Maybe all I needed was a reboot, but adding this one-liner to my .bashrc saved the day!
PATH=$PATH:/c/Users/rafim/AppData/Local/Programs/oh-my-posh/bin
Now, it's working as intended :)
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Code of Conduct
What happened?
bash: oh-my-posh: command not found
This is the error I get whenever I startup Git Bash. I am not sure why it is saying not found.
I get the same issue in the integrated terminal of VSCode too.
However, in Windows Terminal, the theme loads as expected:
P.S. This is a separate question, but I am struggling to enable oh-my-posh for Windows Command Prompt. Could someone guide me on how to go about doing so?
Theme
microverse-power
What OS are you seeing the problem on?
Windows
Which shell are you using?
bash
Log output