Bild no Database

Windows Terminal Step by step guide

Microsoft has redesigned the command line. Under the name Windows Terminal an
application has emerged, which unites many shells (e.g. CMD, PowerShell and WSL)
under one user interface.
This article describes how to install the Windows Terminal, adapt it to your own
needs – we want to make working with Git more pleasant – and the terminal in Visual
Studio code embeds.

Step by step guide

Prerequisites:
– PowerShell (at least V6) is installed.
– Git for Windows is installed.
– Visual Studio Code is installed.

Besides Windows Terminal, we will also install the following extensions:- Posh-Git is a PowerShell module that can display the status of a Git repository, and
can complete the Git commands as you type.
– Oh-My-Posh is an extension that offers different themes (colors).
– Get-ChildItemColor is an extension that colors the return of the cmdlet.
– Cascadia font for correct display of Git status characters.

  1. Install Windows Terminal.
    The recommended way is to install via the Store.
  2. Install extensions.
    Open PowerShell as administrator, then change the policy:
				
					Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm
				
			

After that, the extensions are installed:

				
					PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force
 Install-Module oh-my-posh -Scope CurrentUser
 Install-Module -AllowClobber Get-ChildItemColor
				
			

3. load extensions on Windows Terminal startup.

In order for the modules to be loaded when the terminal is started, they must be written
to a profile file

To do this, first call this file using Visual Studio Code:

				
					code $profile
				
			

If the file does not exist yet, Visual Studio will create it automatically. This file must be
supplemented by the following lines:

				
					Import-Module posh-git
Import-Module oh-my-posh
Import-Module Get-ChildItemColor
Set-Theme Avit
				
			

The theme Avit is loaded here, other themes can be viewed at Oh-My-Posh.

4. Install and use the font.

After downloading the zip package, it must be unpacked. We use
CascadiaCodePL.ttf here, so it must be installed
(e.g. using the right mouse button).

Now we need to start Windows Terminal and call Settings. In this file we make the following
entries under profiles defaults:

				
					...
"profiles":
 {
 "defaults":
 {
 // Put settings here that you want to apply to all profiles.
 "fontFace": "Cascadia Code PL",
 "fontSize": 10
 },
 "list":
 [
 ...
 ]
}
...

				
			

This sets the same font for all profiles.

5. change background of Windows Terminal.
All profiles should have the same background image, that’s why we add the section
defaults:

				
					...
"profiles":
 "defaults": {
 ...
 "backgroundImage": "C:/.images/background.png",
 "backgroundImageOpacity": 0.3
 },
...

				
			

If you want to use the Acrylic effect of Windows 10, add the following:

				
					"useAcrylic": true,
"acrylicOpacity": 0.3
				
			

By simply changing the theme in the profile file, the Git information can be
represent in different ways.

6. use Windows Terminal in Visual Studio code.

If you open Visual Studio Code and then open Terminal New Terminal and switch
to PowerShell, everything should already look like it does in Windows Terminal.

If the glyphs are not displayed correctly, you only have to enter the same font
as before in the settings.json file (callable e.g. via the command palette):

				
					"terminal.integrated.fontFamily": "Cascadia Code PL"
				
			

Table of contents