Let's beautify the Windows Terminal

Let's beautify the Windows Terminal

ยท

3 min read

This is a straightforward & clear-cut guide based on Scott Hanselman's YouTube tutorial.

Let's get you set up!

Install Powershell(.NET Core-powered cross-platform Powershell)

winget install Microsoft.PowerShell

Image description

Install Windows Terminal

winget install Microsoft.WindowsTerminal

Make PowerShell as your default terminal on Windows Terminal

Go to Settings

Image description

Click on Default profile and select PowerShell and save the changes.

Image description

Then go to Profiles > PowerShell > Additional Settings > Appearance.

Here you can customize your fonts by choosing a suitable font with lots of Glyphs.

Image description

Navigate to the following link to explore & download all the trendiest developer nerd fonts: nerdfonts.com/font-downloads

So, we will go with this, github.com/ryanoasis/nerd-fonts/releases/do..

Choose FiraCode NF as Terminal Font.

Install Oh My Posh

winget install JanDeDobbeleer.OhMyPosh -s winget
  • For the PATH to be reloaded, a restart of your terminal is advised

Enter the following code in Terminal to get the exact location of the PowerShell profile.

 echo $profile

Image description

If you don't see any folder titled PowerShell in Documents, Make new folder in that name anyway.

Inside that folder, create a file Microsoft.PowerShell_profile.ps1 where we're gonna add our functionalities.

Following json is being used as theme property to modify Oh My Posh options.

theme.json:

{% embed gist.github.com/hanancs/75f3e1d8095e328c279.. %}

Download theme.json and locate it wherever you want, I'm letting it beside the Microsoft.PowerShell_profile.ps1 file.

Open Microsoft.PowerShell_profile.ps1 and add the following code and save it.

oh-my-posh --init --shell pwsh --config C:\Users\{YOUR PC USER NAME}\Documents\PowerShell\theme.json | Invoke-Expression

Restart your terminal. You will see the difference.

Image description

Install Terminal-Icons

Run the following code in the terminal

Install-Module -Name Terminal-Icons -Repository PSGallery

Image description

And then add this line to Microsoft.PowerShell_profile.ps1 file

Import-Module -Name Terminal-Icons

After your installation; if you run ls, you will notice that all the listed files, got colored with beautiful icons like this:

Image description

Install PSReadLine

PSReadLine will give you the guessings from the previous command history.

Run the following code in the terminal.

Install-Module PSReadLine -AllowPrerelease -Force

And then add these lines to Microsoft.PowerShell_profile.ps1 file

Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History

PSReadLine will help you this way:

Image description

Enable Predictive Intellisense

Predictive intellisense will gather guesses as much as possible.

Add these lines to Microsoft.PowerShell_profile.ps1 file.

Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows

This is the way Predictive Intellisense works:

Image description

Make sure your Microsoft.PowerShell_profile.ps1 file contains code like this:

Image description

Enable the Glassmorphism effect

Go to Windows Terminal > Settings > Open JSON file, then add these fields to defaults. Then save the settings.json file and restart the terminal. You will see wonders.

"defaults": {
   "useAcrylic": true,
   "acrylicOpacity": 0.5
},

Finally!!! you terminal will look like this(if you follow everything precisely):

Image description

ย