Set up your terminal
Oh My Posh uses ANSI color codes under the hood, these should work in every terminal,
but you may have to set the environment variable
xterm-256color for it to work.
To display all icons, we recommend the use of a Nerd Font.
A Homebrew formula is available for easy installation. When installing Homebrew for Linux, be sure to follow Next steps instructions to add Homebrew to your PATH and to your bash shell profile script, and Requirements to build Oh My Posh.
brew install jandedobbeleer/oh-my-posh/oh-my-posh
This installs two things:
oh-my-posh- Executable, added to
themes- The latest Oh My Posh themes
If you want to use a predefined theme, you can find them in
$(brew --prefix oh-my-posh)/themes, referencing them as such
will always keep them compatible when updating Oh My Posh.
brew update && brew upgrade oh-my-posh
In case you see strange behaviour in your shell, reload it after upgrading Oh My Posh. For example in zsh:
brew update && brew upgrade && exec zsh
Oh My Posh can also be installed manually by downloading the release. Depending on your distro, this may or may not work (please refer to the homebrew installation in case it doesn't work).
Download Oh My Posh
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
sudo chmod +x /usr/local/bin/oh-my-posh
Download the themes
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
unzip ~/.poshthemes/themes.zip -d ~/.poshthemes
chmod u+rw ~/.poshthemes/*.omp.*
Now that Oh My Posh is installed, you can go ahead and configure your terminal and shell to get the prompt to look exactly like you want.