Pamper your windows terminal - Customize Prompt
Tags: windowsterminal, terminal
Published: 2021-04-22 19:19:33

**Windows Terminal** (WT) came as a revolution. It was a refreshing delight for all those windows users, who used to stare at the Linux Terminal and wished, can we have it on windows, until now.

Love for Windows Terminal !!

Those who have not tried, what are you waiting for. Give it a try. Trust me it's a game changer.
https://www.microsoft.com/en-in/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab

WT supports Windows PowerShell (Old one that comes installed with windows by default), PowerShell, WSL, CMD, Azure CLI etc. So, whatever terminals are installed on you machine are all integrated under one roof, which you can choose from the drop-down, as you can see in the image below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kv9omjev1n9ebqlxnpxt.png)

Can we make the terminal look even better like this, with a fancy prompt? YEAH !!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1nphjko2huxxoc0jodf.png)



Please follow the steps below:

**Note**: A separate article will be posted soon for WSL users

*For Windows Powershell & [Powershell] (https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7.1) Only*

1. Install Git for Windows from
https://git-scm.com/downloads

2. Run below command on the command prompt

This would install post-git & oh-my-posh

```
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
```

Script execution policy must be set to either RemoteSigned or Unrestricted in order for the profile script to run.

Run this command to check your current execution policy. 
```
Get-ExecutionPolicy
```

Run the below command for setting it.

```
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
```
If it does not work you can try the Force flag.

```
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
``` 


 [Posh-Git](https://github.com/dahlbyk/posh-git) adds Git status information to your prompt and tab completion for Git commands, parameters, remotes, and branch names. 

 [Oh-My-Posh](https://github.com/JanDeDobbeleer/oh-my-posh) provides theme capabilities for your PowerShell prompt.

3.Now, we need to add some lines to your profile, which would be executed every time you open a new tab.

Type the below command on the command prompt

```
notepad $PROFILE
```
It will open up the profile file in notepad. If a profile file does not exist, it will create a new one. If it exists then same will open.

Add below lines to the end of the file, and Save. The file might be empty initially.

```
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme paradox
```
4.Now we need to add the required fonts

Download [Meslo](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip), and save it at a convenient location.

Navigate to the path were the file was downloaded. Unzip Meslo.zip and install the highlighted fonts as shown below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ike3dpzc8ope6crx01wm.png)

Double click each of the font file and install. 
Click the Install button on the window which pops up for the same, as shown below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6kkfyb6z5fg8j1lmcjdt.png)

5.Let's perform the last step.

Open up settings in WT.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8dlpn4spq6u3amnw70kx.png)

It will open up settings.json file in the default editor.

Add below lines to the defaults section.

```
"fontSize": 9,
"fontFace": "MesloLGM NF"
```

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ak1nxn0enoruzavexucl.png)

If you are using latest version of WT, you might get the below screen.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/73cx91vi4y4o59hwqzyu.png)

Don't fret, click on the gear icon as shown above. It will open up settings.json file.

That's It !!

You have patiently followed all the steps.

Enjoy your terminal.

Tip !!

If you want to list down all the themes supported by Oh My Posh, run the below command.

```
 Get-PoshThemes 
```
You will get output like below

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/poxozv6t9vq1o9vv7nol.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dfk0f2jiwcs4f5o2dxoe.png)

If you wish to change a theme, open up the profile file, and change the theme name.

Ex. If I want to change the theme to bubbles

Type below command on the command prompt to open up profile

```
notepad $PROFILE
```
Change the theme name to bubbles as shown below, and save the file.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9l8iyex27oljgom5gciy.png)

Open up another tab now, the theme would be applied.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r185a6ctencx351ut8de.png)

**Repeat the steps for each of the terminals**

For WSL, WSL2 I will be adding another post soon.

Enjoy the customization !!