Using Microsoft Terminal? Let’s customize it with Oh My Zsh.

WSL is probably one of the better options for development on Windows systems actually. Let’s give a better look to the terminal.

Photo by Christopher Gower on Unsplash

You can find this guide also in my repository on GitHub. If you like it, don’t forget to give me a ⭐!

What is WSL?

As Wikipedia says, Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10 and Windows Server 2019.

Basically, it permits you to use the Linux layer on Windows, so you will be able to use Linux commands on the terminal. And for that, Microsoft Terminal is a good option.

Microsoft Terminal is an open-source project from Microsoft and a feature recently added to the OS. It is a new terminal that allows you to use different consoles like CMD, Powershell, Azure, Ubuntu, and etc. Crazy.

But…what if we can use ZSH on the terminal too? Doesn’t sound it awesome? Let’s see.

What is ZSH?

According to Wikipedia, The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.

macOS Catalina, released in October 2019, adopted Zsh as the default shell, replacing Bash.

Definitely, a good shell that you must try at least once, and you can do it in the Microsoft Terminal. So if you are using Windows 10 OS, you will be able to get Linux commands on a brand new terminal, with a cool look and with Zsh inside. Cool enough.

Let follow these steps:

1. Install the new Microsoft (Windows) Terminal

You can install it from the Microsoft Store or from the GitHub repository. I personally think that is easier if you install it directly from the Store. With just a few clicks, you will get your brand new terminal installed in your Windows.

2. Later, you must enable Windows Subsystem for Linux (WSL)

This step is easy. Just open your PowerShell with Admin privileges and write the following command to enable WSL:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Later, you have to restart your computer.

3. Download Ubuntu for Windows

Do it directly from the Microsoft Store. Easy step.

4. Set up your Microsoft Terminal with Ubuntu

For that, I invite you to use these following setup:

{
"acrylicOpacity" : 0.5,
"closeOnExit" : true,
"colorScheme" : "Scope",
"commandline" : "wsl.exe -d Ubuntu",
"cursorColor" : "#39e5a7",
"cursorShape" : "bar",
"fontFace" : "Cascadia Code",
"fontSize" : 12,
"guid" : "{`your guid by default`}",
"historySize" : 9001,
"icon" : "`insert the url of your prefered icon`",
"name" : "WSL",
"padding" : "10, 10, 10, 10",
"snapOnInput" : true,
"startingDirectory" : "`insert your default folder (Dev, maybe?)`",
"useAcrylic" : false
}

As you can see, the name of the colorScheme is Scope, since we are going to use this scheme. Later I will explain how to create the scheme.

Take care of the “startingDirectory” row, you will have to add your preferred starting directory.

5. Install Oh My Zsh plugin

For those who don’t know what is Oh My Zsh, it is an open source framework for Zsh. For me, is one of the best existing tools for consoles out there. Trust me, it is worth to try it.

To install Oh My Zsh, please, visit their GitHub repository and read the documentation.

6. Last step: insert the Scope color scheme

Why Scope? Scope is my company. In this case, I will add our color scheme, but you are free to use the colors that you like the most.

Scope is a git analytics tool. We help software managers and engineers to better understand the workflow of the code processes to identify bottlenecks, reduce technical debt, compare trends and become more productive.

For that, go, follow these steps:

  1. Open Microsoft Terminal.
  2. Click in the arrow down, to the right of the tab.
  3. Click on Settings.
  4. A profiles.json file will be opened. Use the code editor you like most. I personally use VScode.
  5. Copy the following commands in the profiles section of the json file.
{
"background" : "#0d0d24",
"black" : "#000000",
"blue" : "#0d0d38",
"brightBlack" : "#767676",
"brightBlue" : "#00e0ff",
"brightCyan" : "#ffd48a",
"brightGreen" : "#39e5a7",
"brightPurple" : "#b4009e",
"brightRed" : "#fa547a",
"brightWhite" : "#ffffff",
"brightYellow" : "#ffd48a",
"cyan" : "#3a96dd",
"foreground" : "#ffffff",
"green" : "#bff7e9",
"name" : "Scope",
"purple" : "#881798",
"red" : "#fa547a",
"white" : "#39e5a7",
"yellow" : "#ffd48a"
},

There you got. That is the final result. As I said, you are free to use the colors you like most. For that, you have to change the colors on the Scope color profile (the commands above).

Feel free to try different Oh My Zsh themes too! You will find all of them in their themes gallery.

Thank you for reading! 👏🏻⭐

Other articles of mine.

  1. What I’ve learned in the earlier months of a Startup: https://medium.com/@alesdonoso/what-ive-learned-in-the-earlier-months-of-a-startup-my-15-tips-19d3f431d443
  2. The importance of using good coding practices: https://medium.com/swlh/the-importance-of-using-good-coding-practices-343c5a91e570

Product Manager at z1.digital. Previously scope.ink.