Paint Your Terminal: A Colorful Guide to Windows Terminal Customization

 

Ever wonder why does your terminal or powershell look so dull? Why doesnt it look like these:

Lets give it a colorful life!

You need the following:

  1. Windows Terminal
  2. oh-my-posh

What is Wndows Terminal and oh-my-posh?

Windows Terminal is a powerful tool for developers who frequently work with command-line interfaces. Any application that has a command line interface can be run inside Windows Terminal. This includes everything from PowerShell and Command Prompt to Azure Cloud Shell and any WSL distribution such as Ubuntu or Oh-My-Zsh. By customizing its appearance, you can make your terminal sessions more enjoyable and efficient. In this article, we’ll explore how to add vibrant colors and stylish themes to your Windows Terminal using Oh-My-Posh.

Installing Windows Terminal

Before we dive into themes, make sure you have Windows Terminal installed. Download canary version from github Or using winget

winget install Microsoft.WindowsTerminal 

Installing oh-my-posh

Using winget

winget install JanDeDobbeleer.OhMyPosh

You can see the available themes here or see them inside Terminal:

Get-PoshThemes

If you get error like this:

then create a powershell profile as follows:

  1. use the following PowerShell command to create a profile
     new-item -type file -path $profile -force
    
  2. Add the following to the end of your PowerShell profile file using notepad to set the paradox theme. (Replace paradox with the theme of your choice.)
    oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\paradox.omp.json" | Invoke-Expression 
    

    Now, each new PowerShell instance will start by importing Oh My Posh and setting your command line theme.

Adding Fonts and Icons

Download the fonts from here

Open PowerShell and select your new font ‘LiberationMono NF’ from the list. You can also download and install Meslo LGM NF fonts. Now Run the code in Powershell

Install-Module Terminal-Icons -Scope CurrentUser

Next, navigate to that path, and you will find a “Microsoft.PowerShell_profile.ps1” file. Open it with Notepad, add the below lines, and save the file. Now, you can close the Notepad file.

Import-Module Terminal-Icons