Customize your windows terminal with Oh My Posh

In this article I’ll walk through the steps to customize your windows terminal using libraries like oh my posh and posh git and also how to use this terminal in VS Code, Let’s get started .

  1. You have to install windows terminal app from the Microsoft app store.

2. You will need to have PowerShell installed on your machine in order to follow through this article, Assuming you have PowerShell installed lets move to the next step.

3. The libraries that we will be using requires permissions in order to work so first let's get that sorted.

  • open your PowerShell as Administrator and run the following command Set-ExecutionPolicy Unrestricted

4. Using PowerShell, install Posh-Git and Oh-My-Posh:

  • Install-Module posh-git -Scope CurrentUser
  • Install-Module oh-my-posh -Scope CurrentUser
  • Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

5. Edit the PowerShell profile:

-> In PowerShell run the following command to open profile :

PS C:\Windows\system64\> notepad $profile

-> In the notepad file that opens paste the following content

Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme paradox

Save the fil and close it, now its almost done.

6. we have to install fonts that support our terminal, down the font from the linkn below:

Meslo LGM NF Font

  • This link will download a .zip file of the fonts extract it in a folder, After extracting select all the files in the folder Ctrl+a -> rightclick -> install .
installing fonts

7. Now that we have the fonts installed we have to change the default font in the Windows terminal application. Open the settings.json file and add the following default section under profiles.

In Windows Terminal open settings
open JSON file
add default section under profiles
  • save the file and restart the terminal.

8. Your terminal should be customized by now. Oh my posh has a number of themes to choose from you can change the theme in the PowerShell profile that we created in step 5.

  • Change the Set-PoshPrompt variable to the theme you like and save the changes
  • All themes that come with oh my posh are listed here.

9. To use the same terminal in Vs code we just have to edit the settings.json filr in VS code.

  • open Vs code
  • open terminal and select Default profile and choose powershell.
Select Default Profile
Choose PowerShell as default terminal
  • Ctrl+shift+p will open the command pallet.
  • type in open settings (JSON)
  • in the setting change the terminal font to “MesloLGM NF”.
Update Terminal font

You can watch the following video where I show how to set up your terminal step by step.