Spice Up Windows Terminal

How to make Powershell a little prettier

Working with the PowerShell in 2020 means fun, because of the new Windows Terminal (get it from Windows Store). It has more power as the old Powershell Console and it is visually adaptable to your personal taste, by installing the wonderful theming engine oh-my-posh from Jan De Dobbeleer.

Original Terminal

Terminal with oh-my-posh

To get Oh-My-Posh properly run, there are several steps to do I want to show here in a nutshell…

Step 1 - Install a suitable font

As the theming engine uses Powerline glyphs, you need to install a font which support them, for example the new Cascadia Code PL from Microsoft. Download, unzip and install the OTF and/or TTF font files via context menu in your Windows Explorer.

Step 2 - Set new font in your settings

Open up you Terminal settings…

Windows Terminal Settings

… and add following new line to the PowerShell section:

1
"fontFace": "Cascadia Code PL",

Font

Step 3 - Install oh-my-posh

Following PowerShell command installs the theming engine itself:

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

If you want to display Git status information also, run this command:

1
Install-Module posh-git -Scope CurrentUser

To let the command-line editing environment to be customized install PSReadline:

1
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

Step 4 - Load on startup

In order to load the theming engine in every new terminal window, edit your PowerShell profile by opening it up with the command …

1
notepad $PROFILE

and add following lines in the upcoming text file:

1
2
3
Import-Module oh-my-posh
Import-Module posh-git
Set-Theme Paradox

Paradox is one of 27 themes available. You will find all themes in your DOCUMENTS folder under ..\WindowsPowerShell\Modules\oh-my-posh\<version>\Themes and some visual representations at https://github.com/JanDeDobbeleer/oh-my-posh?#themes.

#Update, April 2021

Scott Hanselman has mentioned a new improvement recently: Show suitable icons on listing files:

  1. Download and install CaskaydiaCove Nerd Font at https://www.nerdfonts.com/font-downloads
  2. Open Terminal Settings (like in Step 2)
  3. Replace the fontface with "CaskaydiaCove Nerd Font"
  4. Run Install-Module -Name Terminal-Icons -Repository PSGallery in Terminal, opened as administrator
  5. Add Import-Module -Name Terminal-Icons in your profile (like in Step 4)

You will get this on calling dir, for example:

Windows Terminal Icons

More Info

Webmentions

No Webmentions yet...

In case your blog software can't send Webmentions, you can use this form to submit me a mention of this article...


Comments