Customizing your terminal can make a huge difference in your productivity and comfort as a developer. One of the most popular tools to personalize the prompt on Windows is Oh My Posh, which allows you to add attractive visual themes and extra features in both PowerShell and Windows Terminal.
In this article, I’ll walk you through step-by-step on how to transform your Windows terminal with Oh My Posh. Don’t worry if you’ve never customized anything before — I’ll take you from installing PowerShell all the way to making your terminal literally unrecognizable. Ready to add style and pro-level features to your usual console? Let’s go!
📜 Table of Contents
- 💾 Install PowerShell
- 💻 Configure Windows Terminal
- 🤖 Install and Configure Oh My Posh
- 🔝 Level Up with These Modules and Apps
💾 Install PowerShell
Are you still using the old version of PowerShell that comes with Windows? To fully benefit from Oh My Posh, it’s essential to have the latest cross-platform version.
My favorite way to install PowerShell is with Winget because it’s fast and easy, but you can also get it from the Microsoft Store ➡. Your choice!
From a Windows PowerShell window, run:
winget install Microsoft.PowerShell -s winget
💻 Configure Windows Terminal
Since the Windows 11 22H2 update, Windows Terminal is the default terminal. If you don’t have it installed, you can easily install it via Winget or from the Microsoft Store ➡:
winget install Microsoft.WindowsTerminal -s winget
Got it installed? Great! Let’s continue with the setup.
Set Windows Terminal as the default terminal application
Open Windows Terminal, right-click on the title bar (outside the tabs) or click the down arrow next to the last tab and select “Settings.” You can also press Ctrl + ,
to open settings directly.
Find the Startup section. On the right, set PowerShell as the Default Profile and Windows Terminal as the Default Terminal Application. Click “Save.” This sets you up perfectly to continue with the best configuration.
Configure PowerShell script execution policy
PowerShell’s default policies control whether scripts or commands can run. On a Windows desktop, the policy is usually set to “Restricted,” which allows running single commands but not scripts. On Windows Server, the “RemoteSigned” policy lets you run local scripts and commands but requires downloaded scripts to be digitally signed.
For most cases, “RemoteSigned” is enough. Run this command in PowerShell:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
To confirm it worked:
Get-ExecutionPolicy
You should see:
RemoteSigned
🤖 Install and configure Oh My Posh
Oh My Posh is the star of this tutorial. It’s super customizable, beautiful, and has a huge community behind it. What more could you want?
I recommend installing it via Winget, but it’s also available in the Microsoft Store ➡.
From PowerShell, run:
winget install JanDeDobbeleer.OhMyPosh -s winget
Once installed, open a new PowerShell tab so everything loads properly.
Install a font
Oh My Posh is designed to use Nerd Fonts. Nerd Fonts are popular fonts patched to include icons, so you need to install a Nerd Font to see the special icons in Oh My Posh.
oh-my-posh font install
If you prefer to install just for your user, add --user
at the end.
oh-my-posh font install --user
You’ll see a list of fonts; Oh My Posh recommends the “Meslo” font family, which includes “Meslo LGM NF.”
oh-my-posh font install meslo
If you prefer to install just for your user, add --user
at the end and run it without administrator privileges.
Configure Windows Terminal to use a Nerd Font
Open Windows Terminal’s settings JSON file by pressing Ctrl + Shift + ,
or via “Settings > Open JSON file”.
Find the “profiles” > “defaults” section and add this:
{
"profiles": {
"defaults": {
"font": {
"face": "MesloLGM Nerd Font"
}
}
}
}
Save, and your terminal font will update.
Configure Visual Studio Code terminal to use a Nerd Font
In Visual Studio Code, configure the integrated terminal to use the Nerd Font. Open settings (Ctrl + ,
), search for “Integrated: Font Family”, and replace the value with:
Configure PowerShell to use Oh My Posh
Let’s tell PowerShell to load Oh My Posh whenever you start a terminal.
Open your profile with your favorite editor, for example:
code $PROFILE
Add this line and save:
oh-my-posh init pwsh | Invoke-Expression
Reload your profile:
. $PROFILE
Done! You should see your prompt change immediately to something like this:
Set a theme
Oh My Posh comes with several built-in themes. You can explore them in the Oh My Posh themes documentation ➡.
Pick one you like. For example, if you like the minimalist “zash” theme, locate the zash.omp.json
file (usually at $env:POSH_THEMES_PATH/zash.omp.json
) and update your PowerShell profile line to:
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/zash.omp.json" | Invoke-Expression
Save and reload:
. $PROFILE
Enjoy your new look!
If you want to revert to the default theme, just use:
oh-my-posh init pwsh | Invoke-Expression
🔝 Level up by installing these modules and apps
📦 PSReadLine
If you’re on Windows and want to enjoy features common in bash (like syntax highlighting, history search, and key customization) PSReadLine is for you. It enhances PowerShell’s command line editing to be more interactive and user-friendly.
Install the pre-release (more features, might have bugs):
Install-Module PSReadLine -AllowPrerelease -Force
Or the stable version:
Install-Module PSReadLine
Then edit your PowerShell profile:
code $PROFILE
Add at the top of your profile:
Import-Module PSReadLine
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadLineKeyHandler -Key Tab -Function Complete
Save and reload:
. $PROFILE
The benefits of the configuration include:
- Syntax highlighting for commands and arguments
- Command history and tab completion
- Configurable keyboard shortcuts
- Search history with up/down arrows, respecting typed text
Ctrl + arrow keys
to move by wordsCtrl + L
to clear the screen
Check key bindings with:
Get-PSReadLineKeyHandler
Official docs at the PSReadLine GitHub repo➡
📦 winfetch
winfetch
is a PowerShell script that displays system information beautifully (OS, software, hardware) in a visually pleasing way.
To install:
Install-Script winfetch
Confirm both prompts by pressing Y
. Once installed, run:
winfetch
More info at the winfetch GitHub repo ➡
📦 bat
bat
is a clone of cat
that adds syntax highlighting and Git integration.
Install with:
winget install sharkdp.bat
In Windows, install less
as well for paging:
winget install jftuga.less
Usage and details at the bat GitHub repo ➡ y en el less-Windows repo ➡.
📦 eza
eza
is a modern alternative to ls
with colors, metadata, symlink recognition, and Git status support.
Install with:
winget install eza-community.eza
Open a new PowerShell tab to start using it.
See options and docs at the eza GitHub repo➡.
Congratulations! You now have a terminal that’s not only powerful but also stylish. Who knew something so simple could so dramatically improve your daily experience?
Every small tweak is a step toward a smoother, more enjoyable workflow. Keep exploring new themes, combos, and tools!
Icons showing as squares or not displaying? Make sure you’ve selected the Nerd Font in all your terminals. Sometimes you need to fully close and reopen apps for the font to apply.
Can’t run scripts?
Ensure you’ve changed the execution policy with Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
and that you’re using PowerShell, not CMD or Windows PowerShell. System-wide installs may require admin rights.
Prompt not changing after setup?
Check that the Oh My Posh command is at the end of your $PROFILE
file and that you have reloaded your profile (. $PROFILE
). If you edited your profile but don’t see changes, run . $PROFILE
manually.
Photo by Sunrise Kingi on Unsplash