OH MY POSH - Terminal looking great
Overview
This is the font and Oh-My-Posh theme I use in Windows Terminal. This is the guide I use myself to get my configuration running. Feel free to use it as help and use what ever font and theme that You prefer.
Links
https://ohmyposh.dev/ https://www.nerdfonts.com/ https://chrisant996.github.io/clink/ # Needed to get Oh My Posh working in Command Prompt.
https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/Meslo.zip # My prefered font. Copy to C:\Windows\Fonts. Set as perfered font in Windows Terminal before start setup Oh My Posh.
PowerShell
This guide can be used for both PowerShell v5 and v7. Be aware that profile folder name for PowerShell 7 is “PowerShell” and PowerShell 5 is “WindowsPowerShell”.
New-Item -Path $PROFILE -Type File -Force # If Microsoft.PowerShell_profile.ps1 is missing it needs to be created.
Get-ExecutionPolicy -List # To be able to work in PowerShell 5 - As Administrator - ExecutionPolicy need to be set as follow: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
winget install JanDeDobbeleer.OhMyPosh # For installation I prefer to use winget.
Restart PowerShell or Windows Terminal
oh-my-posh init pwsh | Invoke-Expression # Start Oh My Posh the first time.
Get-PoshThemes # Run to get themes.
notepad $profile # Edit PowerShell profile and add following to get Oh My Posh start when PowerShell starts. Standard theme is used if –config is excluded. oh-my-posh init pwsh –config ‘C:\Users\USER\AppData\Local\Programs\oh-my-posh\themes\atomic.omp.json’ | Invoke-Expression # Apply Oh My Posh, and prefered theme.
.$profile # Apply PowerShell profile.
Command Prompt
Check https://ohmyposh.dev/docs/installation/prompt > cmd for additional documentation.
winget install clink # Install clink, when done, Restart Windows Command if open.
clink info # Check path to clink settings
In path C:\Users\USER\AppData\Local\clink
create file oh-my-posh.lua
and add following to the file load(io.popen(‘oh-my-posh init cmd’):read("*a"))()
Save file and restart Command Prompt
clink config prompt use oh-my-posh clink set ohmyposh.theme C:\Users\USER\AppData\Local\Programs\oh-my-posh\themes\atomic.omp.json
Restart Windows Terminal and check that Oh My Posh working on PowerShell and Command Prompt. For troubleshooting, please use provided links above.
Ubuntu in WSL2
Start Ubuntu and logon as your user.
curl -s https://ohmyposh.dev/install.sh | bash -s
nano .bashrc
Insert line: eval “$(~/.local/bin/oh-my-posh init bash –config ~/.atomic.omp.json)” Save. Get json code here: https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/atomic.omp.json
Restart