Windows
Set up your terminal
While Oh My Posh works on the standard terminal, we advise using the Windows Terminal.
To display all icons, we recommend the use of a Nerd Font.
When using oh-my-posh inside the WSL, make sure to follow the Linux installation guide.
Installation
- winget
- manual
- chocolatey
Open a PowerShell prompt and run the following command:
winget install JanDeDobbeleer.OhMyPosh --source winget --scope user --force
Replace --scope user
with --scope machine
if you want to install Oh My Posh for all users on the machine.
Open a PowerShell prompt and run the following command:
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
The chocolatey package is maintained by the community and might not be up to date. In case of issues, please contact the maintainer.
Open a PowerShell prompt and run the following command:
choco install oh-my-posh
For the PATH
to be reloaded, a restart of your terminal is advised.
If oh-my-posh is not recognized as a command, you can run the installer again, or add it manually to your PATH
.
For example:
$env:Path += ";C:\Users\user\AppData\Local\Programs\oh-my-posh\bin"
Due to frequent updates of Oh My Posh, Antivirus software occasionally flags it (false positive). To ensure Oh My Posh isn't blocked you can either report it to your favorite Antivirus software as a false positive (e.g. Report a false positive/negative to Microsoft for analysis) or create an exclusion for it. Exclusions should be added with the full path to the executable, you can get it with the following command from a PowerShell prompt:
(Get-Command oh-my-posh).Source
Next
Now that Oh My Posh is installed, you can go ahead and configure your terminal and shell to get the prompt to look exactly like you want.
- install a font
- configure your terminal/editor to use the installed font
- configure your shell to use Oh My Posh
- (optional) configure a theme or custom prompt configuration
Update
- winget
- manual
- chocolatey
Open a PowerShell prompt and run the following command:
winget upgrade JanDeDobbeleer.OhMyPosh --source winget --scope user --force
Replace --scope user
with --scope machine
if you want to upgrade Oh My Posh for all users on the machine.
Open a PowerShell prompt and run the following command:
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
The chocolatey package is maintained by the community and might not be up to date. In case of issues, please contact the maintainer.
Open a PowerShell prompt and run the following command:
choco upgrade oh-my-posh