← back to posts

Oh My Posh: Supercharge Your Terminal Prompt

Your terminal prompt is the one thing you stare at all day as a developer. By default it’s something like C:\Users\you> or user@machine:~$ — functional, but completely silent about everything that actually matters: what branch are you on, did that last command fail, which Node version is active, is the build broken? Oh My Posh fixes all of that, and it looks stunning while doing it.


What Is Oh My Posh?

Oh My Posh is an open-source, cross-platform prompt engine built in Go. Originally inspired by Oh My Zsh and Powerline, it has evolved into a fully independent tool that works on every major shell and operating system — with a single config file that follows you everywhere.

It replaces your static prompt with a dynamic, segment-based display that adapts to context: when you’re in a Git repo it shows branch and status, when you’re in a Node project it shows the runtime version, when a command fails it highlights the exit code. All of it configurable, all of it fast.

Oh My Posh in action — Python version, Git branch, and path segments in WSL

“The most customizable and fastest prompt engine for any shell.”

Key stats:

  • 170+ built-in themes
  • 180+ available segments
  • Works on Windows, macOS, Linux, WSL, SSH, containers
  • Supports PowerShell, Bash, Zsh, Fish, Nu Shell, and more
  • Built with Go — sub-millisecond rendering via smart caching and async operations

Why Developers Love It

A plain prompt tells you where you are. Oh My Posh tells you what’s happening:

Without Oh My PoshWith Oh My Posh
C:\Projects\app>main ✓ ●2 ✗1 + Node 20.11 + exit 0
You cd to check branchBranch shown inline, always
You run node -v manuallyRuntime version in prompt, automatically
Failed command looks the sameExit code highlighted in red
Same prompt everywhereContext-aware: Git, cloud, battery, time

For developers specifically:

  • Git at a glance — branch name, staged/unstaged changes, commits ahead/behind, stash count. No more running git status just to remember where you are.
  • Language version awareness — automatically shows Node, Python, Go, Rust, .NET, Ruby, Java versions when you enter a relevant project directory. Switch versions with nvm or pyenv and the prompt updates instantly.
  • Command duration — long-running commands show elapsed time. Know immediately if that build took 3s or 3min.
  • Exit code visibility — failed commands are visually distinct. Never miss a silent failure again.
  • Cloud context — Azure, AWS, and GCP segments show your active subscription or profile.
  • Consistent cross-machine — one .omp.json in your dotfiles repo means the same prompt on every machine, every OS.

Installation

1
winget install JanDeDobbeleer.OhMyPosh --source winget

Alternatively via Chocolatey (community-maintained):

1
choco install oh-my-posh

Or the manual PowerShell installer:

1
2
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))

macOS

1
brew install jandedobbeleer/oh-my-posh/oh-my-posh

Linux

1
curl -s https://ohmyposh.dev/install.sh | bash -s

Verify

1
oh-my-posh --version

Step 1: Install a Nerd Font

Oh My Posh uses glyphs — icons for Git, language logos, arrows, separators — that require a Nerd Font. Without one you’ll see boxes and question marks instead of icons.

Install directly via Oh My Posh:

1
2
3
4
5
# List available fonts
oh-my-posh font list

# Install a specific font (Meslo is widely recommended)
oh-my-posh font install meslo

Then set the font in your terminal:

  • Windows Terminal: Settings → Profile → Appearance → Font face → MesloLGM Nerd Font
  • VS Code: add "terminal.integrated.fontFamily": "MesloLGM Nerd Font" to settings.json

Popular Nerd Fonts: MesloLGM, CaskaydiaCove, FiraCode, JetBrainsMono


Step 2: Configure Your Shell

PowerShell

Open your profile:

1
notepad $PROFILE

Add:

1
oh-my-posh init pwsh | Invoke-Expression

Reload:

1
. $PROFILE

PowerShell profile configured with oh-my-posh init and catppuccin theme

Bash

Add to ~/.bashrc:

1
eval "$(oh-my-posh init bash)"

Reload:

1
exec bash

Zsh

Add to ~/.zshrc:

1
eval "$(oh-my-posh init zsh)"

Fish

Add to ~/.config/fish/config.fish:

1
oh-my-posh init fish | source

Step 3: Choose a Theme

Oh My Posh ships with 170+ themes out of the box. Preview them all in the terminal:

1
Get-PoshThemes

This cycles through every theme applied to your actual prompt. Pick one you like, then set it in your profile:

1
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression

Popular themes:

ThemeStyle
jandedobbeleerDefault — colorful, multi-segment
powerlevel10k_rainbowRainbow blocks, detailed info
catppuccinSoft pastel tones
draculaDark, purple-accented
pureMinimal single-line
agnosterClassic Powerline style
night-owlDark blue, high contrast
cobalt2Cobalt blue, clean
clean-detailedMinimal but informative

Themes live in $env:POSH_THEMES_PATH on Windows and $(brew --prefix oh-my-posh)/themes on macOS.

Oh My Posh prompt in Windows Terminal — Git branch and directory highlighted


Segments: What Your Prompt Can Show

Segments are the building blocks of an Oh My Posh prompt. Each one displays a single category of information and appears only when relevant — Node version shows up inside a Node project, Git status shows up inside a repo. There are 180+ segments available.

Developer Essentials

SegmentWhat It Shows
gitBranch, staged/unstaged count, commits ahead/behind, stash, upstream
nodeNode.js version (when package.json is present)
pythonPython version + active virtualenv name
goGo version (when go.mod is present)
rustRust toolchain version (when Cargo.toml is present)
dotnet.NET SDK version (when .csproj or .sln is present)
javaJava version (when pom.xml or build.gradle is present)
rubyRuby version (when Gemfile is present)
phpPHP version (when composer.json is present)

System & Context

SegmentWhat It Shows
pathCurrent directory with smart shortening
exitLast command exit code + status icon
executiontimeDuration of the last command (above configurable threshold)
timeCurrent time
batteryBattery level + charging status
osOS logo icon
rootHighlights when running as admin/root
shellActive shell name

Cloud & DevOps

SegmentWhat It Shows
azActive Azure subscription
awsActive AWS profile + region
gcpActive GCP project
kubectlActive Kubernetes context + namespace
dockerActive Docker context
terraformActive Terraform workspace
pulumiActive Pulumi stack

Fun & Utility

SegmentWhat It Shows
sysinfoCPU and RAM usage
spotifyCurrently playing track
wakatimeCoding activity stats
githubGitHub notification count
weatherLocal weather conditions

Customization: Building Your Own Theme

Themes are JSON (also supports TOML and YAML) config files. Here’s a minimal custom config — a two-line prompt showing path, Git branch, and Node version:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "path",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "#ffffff",
          "background": "#61AFEF",
          "properties": {
            "style": "folder"
          }
        },
        {
          "type": "git",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "#ffffff",
          "background": "#98C379",
          "properties": {
            "branch_icon": " ",
            "fetch_status": true
          }
        },
        {
          "type": "node",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "#ffffff",
          "background": "#E5C07B"
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "type": "text",
          "style": "plain",
          "foreground": "#61AFEF",
          "template": "❯ "
        }
      ]
    }
  ],
  "version": 2
}

Save as ~/.config/omp.json, then point your shell init at it:

1
oh-my-posh init pwsh --config "$HOME\.config\omp.json" | Invoke-Expression

The $schema line enables IntelliSense in VS Code when editing the config — every property is documented inline as you type.


Keeping Oh My Posh Updated

1
2
3
4
5
# Via winget
winget upgrade JanDeDobbeleer.OhMyPosh

# Via the built-in updater
oh-my-posh upgrade

Tips

  • Start with a built-in theme — run Get-PoshThemes, pick one, copy its file from $env:POSH_THEMES_PATH, then edit it as your own baseline.
  • Slow Git repos — large monorepos can make the Git segment sluggish. Set "fetch_status": false to keep branch display but skip status counting.
  • Dotfiles — commit your .omp.json to a dotfiles repo. Symlink it on every machine so every update propagates everywhere.
  • VS Code terminal — set "terminal.integrated.fontFamily" to your Nerd Font or icons won’t render inside the editor.
  • WSL — install Oh My Posh separately inside WSL using the Linux installer. Don’t reuse the Windows binary across the boundary.
  • oh-my-posh get shell — run this if Oh My Posh isn’t initializing correctly; confirms which shell it detected.

Conclusion

Oh My Posh seems like a cosmetic upgrade until you’ve used it for a week — then you can’t imagine working without it. The Git segment alone eliminates dozens of manual status checks per day. Language version awareness prevents the classic “why isn’t this running” moment caused by a wrong runtime. And the command duration display quietly trains you to notice which operations are actually slow.

It’s free, open-source, cross-platform, and installs in under two minutes. Your terminal is where you live as a developer — it should work as hard as you do.

1
winget install JanDeDobbeleer.OhMyPosh --source winget