Let's beautify the Windows Terminal
Ben Subendran
Posted on July 4, 2022
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
Install Windows Terminal
winget install Microsoft.WindowsTerminal
Make PowerShell as your default terminal on Windows Terminal
Go to Settings
Click on Default profile and select PowerShell and save the changes.
Then go to Profiles > PowerShell > Additional Settings > Appearance.
Here you can customize your fonts by choosing a suitable font with lots of Glyphs.
Navigate to the following link to explore & download all the trendiest developer nerd fonts: https://www.nerdfonts.com/font-downloads
So, we will go with this, https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip
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
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:
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.
Install Terminal-Icons
Run the following code in the terminal
Install-Module -Name Terminal-Icons -Repository PSGallery
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:
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:
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:
Make sure your Microsoft.PowerShell_profile.ps1 file contains code like this:
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):
Posted on July 4, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.