Oh My Posh¶
Oh My Posh is a tool designed to enhance the user experience and productivity of individuals working with command-line interfaces by allowing them to customize their shell prompts.
Install Windows Terminal¶
Install Oh My Posh¶
Check for updates for Oh My Posh¶
Install a font¶
Choose your font, I like Meslo.
Configure apps to use the Font¶
Windows Terminal¶
Once installed configure Terminal to use it by editing the settings.json
file. An easy way to open this file is to hit Ctrl + Shift + ,
when Terminal is in focus.
Under the defaults
block set the font.
Visual Studio Code¶
Whilst in VScode enter Ctrl + ,
to open the Settings page. Search for Integrated: Font Family
and paste the name of the Font you are using.
Configure Powershell to use Oh My Posh¶
Open the Powershell profile text file.
Add the following line
Reload your Powershell session to trigger the change
Warning
You may encounter an error about running scripts
Run the following in an elevated Terminal
Set-ExecutionPolicy RemoteSigned
Themes¶
An easy way to use a theme is to live load it from the GitHub repo which will cache it to your system. To use a theme just edit the command from above and provide the URI for the theme. Below I have configured my Terminal to use thecyberden
theme.
oh-my-posh init pwsh --config 'https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/thecyberden.omp.json' | Invoke-Expression
Predictive Intellisense¶
Install the library.
Add this to $PROFILE
# Add auto complete (requires PSReadline 2.2.0-beta1+ prerelease)
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
My $PROFILE¶
# Load oh-my-posh
oh-my-posh init pwsh --config 'https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/thecyberden.omp.json' | Invoke-Expression
# Add auto complete (requires PSReadline 2.2.0-beta1+ prerelease)
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
# Additional icons
Import-Module -Name Terminal-Icons