Customizing the Powershell terminal with oh-my-posh

Motivation

Default terminal in a powershell looks like the following and this blog helps in making the terminal look fancy with features

Before

before

After

powershell terminal customized

Nice to have

Good to have the Windows Terminal (or Preview) app installed from Windows app store for customizing the font windows terminal app

Steps

Install Nerdfonts

Fonts can be previewed using https://www.programmingfonts.org/#agave

  • Pick any font available here and install it on the Windows machine by downloading it

  • Download the zip file and extract the ttf files
  • Right click and hit install as shown below

font install

Install winget on the machine

There are multiple ways of installing wingeton a given windows machine. One easier thing would be to look for winget in the Windows Appstore and shows up as App Installer.

Sometimes this doesn't go through and a reliable way to install winget would be, via the github releases of official git repository: https://github.com/microsoft/winget-cli/releases msixbundle winget

Double click on the .msixbundle file and go through the prompts and Winget will be installed winget installed winget installed

Install oh-my-posh

Run the following command

winget install JanDeDobbeleer.OhMyPosh

Expected output should look similar to the Following

Found Oh My Posh [JanDeDobbeleer.OhMyPosh] Version 8.13.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v8.13.1/install-amd64.exe
  ██████████████████████████████  6.55 MB / 6.55 MB
Successfully verified installer hash
Starting package install...
Successfully installed

Add the oh-my-posh command to Powershell profile file

  • Use your favorite text editor and open $PROFILE file, which gets run before the powershell launches, using VSCode (code) here to launch the profile file

    code $PROFILE
    
  • Add the following linked

    oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\paradox.omp.json" | Invoke-Expression
    

    Restart Windows Terminal App

Update the font in the Windows terminal settings app

  • Set the font to the downloaded nerd font type face font change terminal

Result

powershell terminal customized

References

Latest Blogposts

Github login using access token via command line

Logging in using github access token (no more passwords)

29 September 2021

Adding Google Analytics to NuxtJS app

Adding Google Analytics GA4 property to NuxtJS App

2 September 2021

Productive Taskbar Settings missing in Windows 11

Very useful Taskbar Settings goes missing in Windows 11.

6 July 2021

Secureboot + Ubuntu + VirtualBox Signing kernel modules

Set of steps required for dealing with secureboot on Ubuntu where VirutalBox service has issues

9 May 2021