Setting up ohmyposh on Mac
Ohmyposh is a custom prompt engine for any shell. It allows you to customise your prompt and make it look pretty! It is cross platform and works on Mac, Windows and Linux.
I had some issues getting it set up, primarily that I couldn’t get the images to show. It is a bit of a faff to set up, but it’s worth the effort. What’s really neat is once it is set up, it is available on all terminals and the configuration is consistent across all of them. The install approach will naturally differ depending on your operating system however, I expect that the configuration steps will be the same.
What does it look like?
The default prompt consists of a light orange segment that shows the user, a darker orange segment that has a folder icon and the name of the directory you are in and a blue segment with a tick that means that the previous command was successful (it will become a red block with a cross if the previous command was invalid).
Here it is in Terminal:
Here it is in my perferred terminal Tabby :
Here it is in vscode:
Install ohmyposh and fonts
Full details here . Installing via brew is the easiest way;
brew install jandedobbeleer/oh-my-posh/oh-my-posh
The next step is to install a nerd font. Nerd fonts are fonts that have additional glyphs that are used by ohmyposh to display icons. To prepare brew, you need to run the following command once;
brew tap homebrew/cask-fonts # this only needs running once
There are many nerd fonts available, you can search for them using this command;
brew search nerd-font
This will return a list of fonts that you can install;
Ohmyposh recommends Meslo LGM NF, but I prefer CaskaydiaCove. To install it, run the following command;
brew install --cask font-caskaydia-cove-nerd-font
So now you have ohmyposh installed and a nerd font installed, next step is to configure the terminals to use the nerd font you’ve installed…
Set terminals to use nerd fonts
Open terminal and go to preferences. Select the profiles tab and in the text section click the change button next to the Font selection:
Another window will appear with a list of fonts. If you click on All Fonts and from there you can choose
CaskaydiaCove Nerd Font:
Open the settings window and search for the term familyfont. The option to change is
Terminal > Ingerated: Font Family and you need to change it to
Note that this was the primary reason that the glyphs weren’t working. From what I understand, there are specific versions that are going to work with vscode, make sure that you have correctly entered the version as written above.
I don’t think you have to set the GPU acceleration option. It was suggested in one of the troubleshooting posts. The description of the option says “Controls whether the terminal will leverage the GPU to do its rendering” so I have set it to auto either way. You can find the option by searching for the term “acceleration” in the search bar. The option is
Terminal > Integrated: Gpu Acceleration;
Open preferences in Tabby and go to the appearance section, set the font to
CaskaydiaCove NFM and turn on Enable font ligatures;
Configure your prompt
Next step is to configure your prompt(s). This differs depending on which shell(s) you use, refer to the ohmyposh documentation for details. Choose which shell(s) you want to configure and follow the instructions.
Once you have run through the prompt guidance the ohmyprompt theme should appear in any terminal you’ve configured. Note that you may need to restart the application to get the prompt to appear.