Windows Terminal — a Versatile, Open Source, Terminal Emulator

Aleksandar Gakovic
DataDrivenInvestor
Published in
4 min readAug 2, 2020

--

Photo by Luca Bravo on Unsplash

Like many others, I began practicing Data Science with a Mac book. I recently set up a Windows OS environment for work with neural networks that utilise the Nvidia CUDA framework. During my early days, I went about learning Git and navigating the command line happily and blissfully ignorant to alternatives. It was only recently that I questioned whether my old command-line interface was the most suitable.

The command-line is an interface programmer’s use to issue text-instructions directly to the operating system without going through a graphical user interface (GUI)

In this article, I’ll give you an idea of how versatile and handy the relatively new Windows Terminal is as an all-purpose command-line interface.

A little history

You see, MacOS comes with Bash (‘Zsh’ since Catalina update), a Unix Shell. Bash stands for ‘Bourne Again SHell’ and had it’s first release 31 years ago in 1989 by Brian Fox. Bash is also the default login shell for most Linux distributions.

Photo by Catarina Carvalho on Unsplash

On Windows OS, however, the default command-line interface is Windows Command Prompt (‘CMD’) and more recently PowerShell with Windows 10. CMD is not capable of a customised Git experience but PowerShell is. The posh-git package — despite having a humorous package name— will let you use Git in your PowerShell. You can also use the Windows subsystem for Linux (‘WSL’), which lets you use GNU (an operating system) / Linux environment without having to dual boot or install a virtual environment.

Until now I had chosen to use Git Bash which also offers a git GUI and allows you to access the BASH shell from any folder or in windows explore by right-clicking. For more information about how Git Bash differs from WSL see here.

Git BASH— a BASH emulation for windows that behaves just like the “git” command in linux and unix environments

In Comes: Windows Terminal

A few days ago I came across Windows Terminal, published on the Microsoft Store in 2019. It includes support for Command Prompt, PowerShell, Windows Subsystem for Linux, Bash and more.

Windows Terminal command-line interface

It also provides multiple-tabs, duplications of the screen, the ability to split the screen, and can host the different command-line interfaces I’ve mentioned above and all at the same time. You can download and install it for free from the Microsoft store.

Multiple-tabs supporting a different CLI in each tab…

Nani? — Translated — What? Image Source

You will need to create a Bash profile as it doesn’t come with one out of the box.

Multiple tab support and a different CLI in each tab

Yes, the Windows terminal is incredible. Multiple-tabs supporting a different CLI in each tab…and as if this wasn’t enough, it's highly customisable. You will need to create a Bash profile as it doesn’t come with one out of the box.

Changeable settings can be accessed with:

Ctrl + ,

You will need a code editor to view the settings.json file that wants to open. I use visual studio code above. Here you will customise your key bindings, add profiles, and colour schemes to your profile and set which command-line interfaces you want to work with.

Get started with customising the Windows Terminal here

You may also want to access the immutable default settings where you will find the default key bindings:

Alt + Ctrl + ,

Adding Bash CLI to the Windows Terminal

If you’ve installed Git Bash with installation defaults, you can paste the code below into the profiles section of the settings.json file

If you have Git Bash installed elsewhere, just change “commandline”
and fix the “icon” accordingly.

{"guid": "{3a20b825-3d22-41ed-b575-9006741aff64}","name": "Git Bash","commandline": "C:\\Program Files\\Git\\bin\\bash.exe","icon": "C:/Program Files/Git/mingw64/share/git/git-for-windows.ico","startingDirectory": "~","hidden": false},

The profile section of settings.json is in the picture below and I have already added the new code here:

Profile section of the mutable settings for Windows Terminal

Now when you go to choose a new tab Git Bash should appear on the list:

Thank you for reading and enjoy the new tool!

Sources

  1. Git — Documentation Hub
  2. Bash — GNU project
  3. Z Shell — Wikipedia #find user guides and best tips at External links
  4. Unix — Wikipedia page
  5. PowerShell — Microsoft Power shell documentation
  6. Posh-Git Package — Use Git in your Windows OS PowerShell
  7. The Windows Subsystem for Linux — Documentation
  8. Git Bash vs WSL — Stack overflow answer explains the main differences
  9. Visual Studio Code — Homepage
  10. Windows Terminal Colour Schemes — Atomcorp

--

--

Practicing Data Scientist. Interested in Games, Gamification, Ocean Sciences, Music, Biology.