Make Window WSL More Awsome

And drop window CMD

Posted by ChenRiang on May 28, 2020

ZSH is another Unix shell that have interacive feel. This article will guide you through on how to installing Oh My Zsh with Powerlevel10k theme.

Example: Powerlevel10k Example

ZSH installation

Make sure WSL is installed before installing ZSH. In my case, I’m using Ubuntu 18 for WSL.

  1. Install zsh : sudo apt install zsh
    1
    
     sudo apt install zsh
    


  2. Verify it with command zsh --version. You will observe the ZSH vesion you have installed. In my case is, zsh 5.4.2 (x86_64-ubuntu-linux-gnu).

  3. Edit bashrc : vim ~/.bashrc and add following at the bottom :

    1
    2
    3
    
     if test -t 1; then
       exec zsh
     fi
    


  4. Refresh bashrc : source ~/.bashrc and your WSL will pop up something like below: ZSH Initialization

  5. Hit “2” and it will configured with the recommeneded configuration.

Install Oh My Zsh

Oh My Zsh is only one of the plugin framework for ZSH. However in this article, we will be using Oh My Zsh.

  1. Install Oh My Zsh :
    1
    
      sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 
    
  2. You will see a new screen as below if the installation is success : Oh My ZSH Installed


Install PowerLevel10k

Make sure GIT is installed.

  1. Clone PowerLevel10k Git repository
    1
    
     git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
    


  2. Add theme into .zshrc
    1
    
     echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
    


  3. Refresh zsh : source ~/.zshrc.

  4. A PowerLevel10k configuration wizard will pop up. Choose and customize your own setting. PowerLevel10k Configuration Wizard

  5. Done.

Note: If the icon cannot be render, double check on terminal properties and make sure font is using MesloLGS NF. MesloLGS NF font

If you could not found the font type, download and install the font type from here.

Reference