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

SLURM Demo on AWS Ubuntu EC2 instance

Demo of slurm usage on a single instance of Ubuntu 24.04 EC2 instances on AWS

29 May 2024

SLURM on WSL

Setting up SLURM on WSL

27 May 2024

Introduction to SLURM

Simple Linux Utility for Resource Management (SLURM)

26 May 2024

How to find a linux machine is a VM (Virtual Machine) or a Bare Metal

If you can SSH into a linux machine and want to find out if its baremetal or Virtual Machine

7 November 2023

Storing Github access token in git credential store

Using git credentials store the github access token to avoid the re-prompting of username and pwd

4 April 2023

Token generation for Registering Self Hosted Github Runner via REST API

Explains how to generate a token using github API to be used in turn with Github self hosted runner registration

21 March 2023