DEV Community

Cover image for How to Set up the Windows terminal with Powershell and Oh My Posh
Alejandro Londoño
Alejandro Londoño

Posted on

How to Set up the Windows terminal with Powershell and Oh My Posh

Hello everyone! Today I gonna show you how to set up the Windows terminal to look great.

✨ Content

  1. Install the Windows terminal
  2. Install Oh My Posh
  3. Install fonts
  4. Install icons
  5. Select the prompt
  6. Set up the terminal background

⚙ Requirements

📚 GitHib Repo


1. Install Windows Terminal

To install this terminal you should have Windows 10 or 11. It's very easy, You direct to the Microsoft store and search Windows terminal and install this option:

windows terminal

Or install the Terminal via this link: https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701

2. Install Oh My Posh

You can install Oh My Posh via Winget, scoop, or manually with PowerShell commands.

I installed it via Winget:

winget install JanDeDobbeleer.OhMyPosh -s winget
Enter fullscreen mode Exit fullscreen mode

3. Install fonts

This part is important because the fonts are giving the icons for their own terminal.

I installed the Hack Nerd Fonts:

Nerd fonts

Then, you should extract the font files and copy them and move to this place.

Note: Search fonts settings, then drag and drop the files and press install fonts.

font install

And Select in the Terminal the Hack Nerd Fonts:

select fonts from terminal

4. Install Icons

For you can see the icons in your terminal, you should install the next repository:

To install:

Install-Module -Name Terminal-Icons -Repository PSGallery
Enter fullscreen mode Exit fullscreen mode

Usage: Copy this code into Microsoft.PowerShell_profile.ps1 file on the route ⇒ C:\Users\YOUR_USER_NAME\OneDrive\Documentos\PowerShell

Import-Module -Name Terminal-Icons
Enter fullscreen mode Exit fullscreen mode

and your terminal looks like this:

terminal icons

5. Select the prompt

Oh My Posh has many themes for the terminal, I like the half-life theme and to select this theme you write inside the config file the next code:

# C:\Users\YOUR_USER_NAME\OneDrive\Documentos\PowerShell\Microsoft.PowerShell_profile.ps1
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\half-life.omp.json" | Invoke-Expression
Enter fullscreen mode Exit fullscreen mode

And this is the result:

terminal prompt

6. Set up the terminal background

Go to the terminal settings and activate the option “Use the acrylic material in the tab row” ubicated in the appearance section and save.

terminal config

Then go to predeterminate values/appearance and in the transparency section active the material acrylic, play with the opacity, and save:

terminal transparency

And the result looks like this:

terminal style

This is what the config file looks like:

oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\half-life.omp.json" | Invoke-Expression

Import-Module -Name Terminal-Icons
Enter fullscreen mode Exit fullscreen mode

And that's all, Thank you for reading, and see you later :)

Top comments (1)

Collapse
 
thefordz profile image
thefordz

How to record screen without background?