Tweak your Windows Terminal
Tags: Windows, Terminal, Windows 10, Zsh, Ohmyposh

Finally, Microsoft Windows has provided a decent terminal which can actually step out of the shadows of the Unix-like systems’ terminals.

New terminal is Open-Source, highly “customizable”, supports tabs, themes and can be installed from Microsoft Store or downloaded from Github. Please note that one of requirements for this software is Windows 10 version 18362.0 or higher.

Personally, it looks nice, but still, something is missing here. Let’s add a little bit of color.

PSColor — Color plugin for PowerShell, provides simple but very handy color highlighting. To install the plugin let’s run the following command:

Install-Module PSColor -Scope CurrentUser

After the installation we need to enable the plugin:

Import-Module PSColor

Now if you navigate to any folder and run ls command you’ll see that the list of files and directories are nicely highlighted. For more information about how to customize PSColor, click here.

For those who were using terminal on Mac, probably aware of zsh (z shell) and the popular extension ohmyzsh, which comes with various plugins and themes. Unfortunately ohmyzsh supports Unix-like systems only, but have no fear, there’s an alternative for Windows: oh-my-posh 😏

Next we will install oh-my-posh itself and the supporting plugin posh-git, type following commands in your terminal:

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

As soon as installation is complete, let’s enable the plugins and set a nice looking theme:

Import-Module posh-git Import-Module oh-my-posh Set-Theme Agnoster

Now the terminal provides you with a lot of handy information, I personally like the git plugin, it’s just hot🔥. The only downside is that if you open a new tab you need to re-enable all plugins and themes again, not good.

To avoid that, let’s add the Import-Module and Set-Theme statements to the $PROFILE. Write the following command in your terminal:

notepad $PROFILE

Copy and paste these statements into the opened notepad window, save it and close it.

Import-Module PSColor

Import-Module posh-git

Import-Module oh-my-posh Set-Theme Agnoster

oh-my-posh has a very vibrant community and provide lots of different themes and plugins, I suggest you to visit oh-my-posh and give a try to couple of them. Below is the way my window looks like…

… as you can see on the first line of the snapshot, some symbols weren’t rendered properly. To fix this I suggest to download a font type which supports glyphs and other symbols and add it to the terminal settings. My all time favorite is Fira Font, which is free and can be downloaded here.

Next step after the font installation, is the customization of the terminal window itself. Click on the arrow-down button by the tab in the terminal window and choose Settings. Now settings file contains a list of profiles provided in JSON format, you can find detailed information about all supported fields and values in this link.

Below you can see the part of my custom profile which includes bunch of settings: font-type, commandline, padding etc.

You can click on this link, in order to get the whole JSON content, which you can copy into your profiles.json file and save it.

So, if you’ve done everything correct, your terminal window should look like this:

That’s all! Big thanks to Tormod Fjeldskår for introducing me to all these cool features during his Upskill event.

Cheers!