Let's beautify the Windows Terminal
Tags: terminal, powershell, ohmyposh, windows
Published: 2022-07-04 23:09:39

This is a straightforward & clear-cut guide based on Scott Hanselman's [YouTube tutorial](https://www.youtube.com/watch?v=VT2L1SXFq9U&t=2011s).

Let's get you set up!

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

```
winget install Microsoft.PowerShell
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nabu2vqpjqw0uht87dej.png)

## Install Windows Terminal

```
winget install Microsoft.WindowsTerminal
```

## Make PowerShell as your default terminal on Windows Terminal

> Go to Settings 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41225rta2xre7s3nl1ew.png)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nty8rzis4vtiu3q8zaqk.png)

> 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qn4iofc1glmu0j7rfozi.png)

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
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anx9pgrot4dzhry5k9gf.png)

> 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 https://gist.github.com/hanancs/75f3e1d8095e328c279aa2331139e834.js %}

> 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oh92pl9gz706rn8unyyb.png)

## Install Terminal-Icons

> Run the following code in the terminal

```
Install-Module -Name Terminal-Icons -Repository PSGallery
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xrnrz09qt603sxkldjw4.png)

> 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r3nzk3w6vuzgkxkmwvwe.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzvvhm2m46gt37u54prj.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bgwnr11cxf4q5lori2ur.png)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r6seuj0u11c2zq5kpo18.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ld7qph803hg807xbfkol.png)