Just like V2, oh-my-posh is available in the PowerShell gallery.
Over the years, I switched operating system/main shell quite a lot, even on Windows via the WSL. This made it so that my prompt wasn't portable enough, I wanted the same visual/functional experience regardless of the shell I was working in.
- hard to extend/adjust when you're not proficient
- the need to expose a lot of functions/settings to allow ease of personalization
- limited to Powershell
This brings us to the first change, to allow a cross-platform experience, Oh My Posh is written entirely in Go. That way, cross-platform binaries can be shipped which render the same prompt using the same config anywhere.
The configuration is changed from
$ThemeSettings towards a
.json file that only contains the configuration for the
blocks and segments you want to render. See concept for more context on that part.
Let's have a look at the V2 commands and how to move towards V3.
Stays the same! Alright. All you need to do is update oh-my-posh.
Here we have a few options. If you're using an out-of-the-box theme, you can simply change the current command to the new one, provided your V2 theme has already been added to oh-my-posh.
Change the current prompt setting function to the new one.
The first thing to do is to look for the theme you based your theme on. If you don't remember which one, preview them all and take the one closest to yours.
If you see one you like, set it, then export its config so you can customize/extend the blocks and segments.
Adjust the config (
~/.oh-my-posh.omp.json) to your liking by going through the configuration guide.
Set your custom theme and enjoy.
Great! There's an option for that too. You can easily list all available themes and pick the one you like best.
Choose and set the one you like.