
Intro
Ever felt like your terminal was boring, looking like it was stuck in 1984? Or did those identical WSL boxes make you nuke the wrong OS by mistake ☠️? Don’t sweat it—Oh My Posh is here to save the day, give your terminal the glow-up it deserves, and bring some serious style to your shell game. Time to ditch your wack prompts and level up!🚀
🎨After a stupidly uninstalling vault from the wrong box this week, I decided to do a full revamp of all my lab terminals, and we think you’ll like those dope colors🔥on your terminal in this little tutorial 😉.
🧑🏼🚀What is Oh My Posh?
Features:
- Colors: Enhance your terminal’s visuals with a full spectrum of colors.
- Customizable: Tailor existing themes or create your own from scratch.
- Portable: Keep your setup consistent across multiple machines and shells.
Getting Started: Installing Oh My Posh
WSL/Linux
1. Install
curl -s https://ohmyposh.dev/install.sh | bash -s
2. Install & select Nerd Font for Oh My Posh
Please check available previews
$ oh-my-posh font install
Select font
> 0xProto
3270
Agave
AnonymousPro
Arimo
AurulentSansMono
BigBlueTerminal
BitstreamVeraSansMono
$ oh-my-posh font install meslo
Successfully installed Meslo 🚀
The following font families are now available for configuration:
• MesloLGL Nerd Font ...
Once you have installed a Nerd Font, you will need to configure the Windows Terminal to use it. Modify Windows Terminal settings (CTRL + SHIFT + ,
). In your settings.json
file, add the font.face
attribute under the defaults
attribute in profiles
:
{
"profiles":
{
"defaults":
{
"font":
{
"face": "MesloLGM Nerd Font"
}
}
}
}
3. Configure your shell to use Oh My Posh
- Select and download Oh my posh themes to
~/.config/themes
My favorites ❤️🔥: M365Princess | cloud-native-azure.omp.json | iterm2.omp.json | jandedobbeleer.omp.json
jtracey93.omp.json | remk.omp.json | dracula.omp.json - Add oh-my-posh command to
~/.bashrc
(or~/.bash_profile
):
eval "$(oh-my-posh init bash)"
- Set a custom theme
eval "$(oh-my-posh init bash --config ~/.config/themes/M365Princess.omp.json)"
- Once added, reload your profile for the changes to take effect.
exec bash
Windows
1. Install
Open a PowerShell prompt and run installation command :
PowerShell
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient)
2. get the themes
the below command downloads all themes on your C:\Users\%user%\AppData\Local\Programs\oh-my-posh\themes\
Get-PoshThemes
3. Configure your Powershell to use Oh My Posh
Adjust the Oh My Posh init line in your $PROFILE
by adding the –config flag with the location of your configuration.
notepad $PROFILE
>>> add below line with accordig json theme file
oh-my-posh init pwsh --config /Mypath/jandedobbeleer.omp.json | Invoke-Expression
Once altered, reload your profile for the changes to take effect.
. $PROFILE
CMD
There’s no out-of-the-box support for Windows CMD when it comes to custom prompts. There is however a way to do it using Clink, which at the same time supercharges your cmd experience. Follow the installation instructions and make sure you select autostart.
1. Download clink
- Downloads are available from the releases page.
- Clink is configured for autorun, just start
cmd.exe
clink autorun install
2. Create a new file called oh-my-posh.lua
in your Clink scripts directory
- run
clink info
inside cmd to find that file’s location.
clink info | grep scripts
scripts : C:\Program Files (x86)\clink ; C:\Users\%user%\AppData\Local\clink
- Put any of the Oh my posh themes you like in either of the directories
- Open Notepad and create a file named
oh-my-posh.lua
load(io.popen('oh-my-posh init cmd'):read("*a"))()
You can also use a custom theme
load(io.popen('oh-my-posh init cmd --config C:/Users/Posh/jandedobbeleer.omp.json'):read("*a"))()
To set the configuration file, use the following command:
clink config prompt use oh-my-posh
Customization using clink
Clink has builtin support for Oh My Posh. It allows you to set the prompt using the clink
command.
clink set ohmyposh.theme <path>
######### Example ##########
clink set ohmyposh.theme ~\oh-my-posh\themes\aliens.omp.json
Conclusion (From Nada to PRADA)
With this tutorial, you’re now all set to glow-up your prompts in any shell like a true pro. I hope this one-stop guide helps you bring some serious style to your terminal, making your lab setups not just functional but fun! Plus, it should save you the hassle of wasting half a day scouring the web to piece it all together. Now, go rock those dope prompts!
Resources
Oh My Posh Official Site
Nerd Fonts Repository
Clink Documentation
https://windowsterminalthemes.dev/