How to Set up the Windows terminal with Powershell and Oh My Posh
Tags: terminal, tutorial, beginners, windows
Published: 2023-04-23 17:46:15

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

- Windows ≥ 10
- [Oh My Posh](https://ohmyposh.dev/)
- [Nerd fonts](https://www.nerdfonts.com/)

## 📚 GitHib Repo
- [https://github.com/slydragonn/dotfiles](https://github.com/slydragonn/dotfiles)

---

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

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.

- [ohmyposh.dev](https://ohmyposh.dev/docs/installation/windows)

I installed it via Winget:
```bash
winget install JanDeDobbeleer.OhMyPosh -s winget
```

### 3. Install fonts

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

- [NerdFonts](https://www.nerdfonts.com/)

I installed the Hack Nerd Fonts:

![Nerd fonts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c9hi7zdcj4vkephvx8bs.png)

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

And Select in the Terminal the Hack Nerd Fonts:

![select fonts from terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bf74r8izn5hpccgd16fh.png)


### 4. Install Icons

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

- [devblackops/Terminal-Icons](https://github.com/devblackops/Terminal-Icons)

To install:
```bash
Install-Module -Name Terminal-Icons -Repository PSGallery
```

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

```bash
Import-Module -Name Terminal-Icons
```

and your terminal looks like this:

![terminal icons](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/twwqb5owpm9c5tfs0zwv.png)

### 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:

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

And this is the result:

![terminal prompt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bocju5enxnedb3g83fte.png)

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

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

![terminal transparency](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwtcffld9r77mb98x3xg.png)

And the result looks like this:

![terminal style](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ervv0rtqc4dul74830y.png)

This is what the config file looks like:

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

Import-Module -Name Terminal-Icons
```

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