Beautiful Windows Terminal on WSL with zsh 
Tags: zsh, windows, terminal, powerlevel9k
Published: 2020-05-27 14:54:03

## Terminal Experience in Windows vs MacOS
I spend most of the time working on my personal project on `MacOS` and I love it. The fact that its *nix OS makes it very pleasant to work in the terminal. Customizing the terminal pretty easy compared to the limitation introduced by windows.

Don't get me wrong, I don't hate windows, I like windows, I personally use my PC when I working with something that requires a lot of resources **(my pc spec is much better than my mac)** such as `kubernetes`, `docker`, `vargrant` and many other things.

But the experience working on Windows terminal is not very pleasant. I typed 'ls for countless times on Windows terminal (and I still do). I workaround things using `ConEmu` but I still think it is not enough.

## Pengwin and Zsh
I uninstalled my ubuntu looking for something new, I'm getting `pengwin`. It is an awesome alternative for WSL. [Check this out](https://github.com/WhitewaterFoundry/Pengwin) and here is how the out of the box terminal looked like:
![Default Pengwin Terminal](https://dev-to-uploads.s3.amazonaws.com/i/4o1wvsog0lx4v0377c35.png)

## The tricky part
So when I set up my terminal with `oh-my-zsh` and `powerlevel9k`, here is how it looked like:
![Default Pengwin with ZSH](https://dev-to-uploads.s3.amazonaws.com/i/uwz20bi57hes6nfso7xe.png)

What happened is:
* I have set up my zsh (just like when i setup it in mac, we will talk about it in the next section)
* I have all the necessary fonts installed
* The font still looks missing 

I came to realized that there is a limitation of fonts that can be used in the terminal.

## Setting up the terminal
### Install oh-my-zsh
* The detail of the installation is [here](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
```bash
sudo apt install zsh
sh -c "$(curl -fsSL 
https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
### Install the needed fonts
I would recommend installing nerd-fonts. Here is the one I am using, but you can use pretty much install whichever you comfortable with.

[Sauce Code Pro Regular] (https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/SourceCodePro/Regular/complete)

You may download and double click and install the fonts. Sometimes the fonts are not appearing in the Properties of the terminal. And It is a limitation for us to set up a lot of things in the default terminal. So we would need a terminal wrapper. We will use mintty for WSL called `wsltty`

### Install [wsltty](https://github.com/mintty/wsltty)
The easiest is using `chocolatey`
* `choco install wsltty` 
* Have a look at the official documentation as it might be changing time to time.
* The Start menu folder WSLtty contains the link `configure WSL shortcuts`. This function is initially run when wsltty is installed. If should be rerun after adding or removing WSL distributions, in order to create the respective set of shortcuts in the Start menu.

### Install [Powerlevel9k](https://github.com/Powerlevel9k/powerlevel9k/)
What you need is pretty much only to clone the powerlevel9k repository and copy the theme into `oh-my-zsh` theme folder. The configuration folder was generated when we installed `oh-my-zsh` in the previous steps. To do that we can execute this:
```
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
```

### Configure Powerlevel9k Theme
The theme could be configured in `~/.zshrc` file, you may refer to [show your config](https://github.com/Powerlevel9k/powerlevel9k/wiki/show-off-your-config) section in the repository.

I used this [tacolizard theme](https://github.com/Powerlevel9k/powerlevel9k/wiki/show-off-your-config#tacolizards-configuration) for starting 

### Configure `wsltty`
I like to configure my terminal using darcula theme on medium opacity. We should also configure the appropriate fonts for the terminal, in this case we will use the `Sauce Code Pro Regular`. 

Terminal settings as follows:
![Terminal Settings](https://dev-to-uploads.s3.amazonaws.com/i/bfii2crmw1ppy87zq8lu.png)

It now looks like the following:
![result](https://dev-to-uploads.s3.amazonaws.com/i/st2w7uzb9254addr2f6j.png)

I think its pretty neat!