Customize your terminal in PowerShell or WSL with Oh My Posh
This tutorial provides some resources and direction to help you customize your command prompt for PowerShell or Windows Subsystem for Linux (WSL) using Oh My Posh. Oh My Posh provides theme capabilities for a fully customized command prompt experience providing Git status color-coding and prompts.
- install Homebrew to recommended directory
Run these two commands in your terminal to add Homebrew to your PATH
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
We recommend that you install GCC
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/chris/.profile eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install gcc
- Install Nerd fonts
I chose RobotoMono Nerd Font, since it has dashed zero, curved and straight character lines.
- Follow the Linux install guide in the Oh My Posh docs
Choose and apply a WSL prompt theme
brew tap jandedobbeleer/oh-my-posh brew install oh-my-posh
- The Oh My Posh themes will be found in the oh-my-posh directory as JSON files.
- Go to
cd $(brew --prefix oh-my-posh), then just
lsfor the list.
- Copy the theme
agnosterto my user's
Add the following to ~/.profile
cp agnoster.omp.json $HOME
Once added, reload your profile for the changes to take effect.
eval "$(oh-my-posh --init --shell bash --config ~/agnoster.omp.json)"