Introduction
Oh My Posh is a shell-agnostic prompt renderer that transforms the terminal prompt into an informative, visually rich status line. It displays Git branch and status, language runtime versions, Kubernetes context, execution time, and dozens of other segments. Written in Go, it runs on Bash, Zsh, Fish, PowerShell, cmd, and Nushell across macOS, Linux, and Windows.
What Oh My Posh Does
- Renders a fully customizable prompt for any shell on any operating system
- Displays segments for Git status, Node/Python/Go/Rust versions, cloud context, and more
- Supports 100+ built-in themes with live preview via the theme browser
- Uses Nerd Font glyphs for icons, separators, and powerline-style segments
- Provides a configuration-driven approach using JSON, YAML, or TOML theme files
Architecture Overview
Oh My Posh is a single Go binary that the shell calls before rendering each prompt. It reads a theme configuration file that defines segments, colors, and layout. Each segment is a Go module that queries system state (Git repo, environment variables, running processes) and formats output. The engine supports primary, secondary, and transient prompts, plus right-aligned segments. Rendering targets ANSI escape sequences compatible with all modern terminal emulators.
Self-Hosting & Configuration
- Install via Homebrew, winget, Scoop, or direct download from GitHub releases
- Add the
evaloroh-my-posh initline to your shell's RC file - Choose a theme from the built-in gallery or create a custom
.omp.jsonfile - Enable specific segments by adding them to the theme config with their properties
- Use
oh-my-posh debugto troubleshoot segment detection and rendering issues
Key Features
- Works identically across Bash, Zsh, Fish, PowerShell, cmd, and Nushell
- 100+ community themes with a visual browser at ohmyposh.dev
- Tooltips that appear contextually when specific tools are detected
- Transient prompt support to keep scrollback clean
- Extensible with custom segments via shell commands or HTTP endpoints
Comparison with Similar Tools
- Starship — Rust-based cross-shell prompt; Oh My Posh offers more theming depth and segment options
- Powerlevel10k — Zsh-only prompt theme; Oh My Posh works across all shells and OS platforms
- Pure — minimalist Zsh prompt; Oh My Posh provides richer information density
- Oh My Zsh — Zsh framework with prompt themes; Oh My Posh is shell-agnostic and standalone
- Tide — Fish-specific prompt; Oh My Posh brings comparable features to every shell
FAQ
Q: Do I need Nerd Fonts installed? A: Themes that use icons require a Nerd Font patched terminal font. Minimal themes work without them.
Q: Does it slow down my shell?
A: Prompt rendering typically takes 20-50ms. The --debug flag shows timing per segment for optimization.
Q: Can I use it alongside Oh My Zsh? A: Yes. Oh My Posh replaces only the prompt theme; Oh My Zsh plugins and aliases continue to work.
Q: How do I create a custom theme?
A: Copy an existing .omp.json file and modify segments, colors, and icons. The documentation covers every segment property.