DEV Community

Alfonz Jan Frithz
Alfonz Jan Frithz

Posted on

Beautiful Windows Terminal on WSL with zsh

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 and here is how the out of the box terminal looked like:
Default Pengwin Terminal

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

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

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

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

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 section in the repository.

I used this tacolizard theme 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

It now looks like the following:
result

I think its pretty neat!

Top comments (1)

Collapse
 
romkatv profile image
Roman Perepelitsa

Powerlevel9k has been discontinued. You might want to upgrade to powerlevel10k.