Sitecore Development with Windows Terminal
Windows Terminal
The new windows terminal is more modern, productive and comes with powerful options. Its like a Chrome browser in the terminal world. Create multiple tabs with a new look and feel. No more boring black background or blue color on a powershell window.
Sitecore Development
In the latest Sitecore development world. We use powershell for many tasks. It will be very easy to use one windows terminal with multiple tabs.
- JSS
- Docker
- Typescript Compiler
- Azure Cloud Shell
- Kubernetes
In my day to day work, I have to keep minimum of 3-4 powershell windows. Now its much convinient when I have tabs for each task and multi panes for task like JSS start and Typescript watch. Especially with the themes support clear visiblity of the current GIT branch and the branch details.
Installation
Install from the Microsoft store or you could install their preview version if you would like to use their new features early. I have been using both and they are much stable. They will also auto update.
Download link https://aka.ms/terminal
Documentation https://aka.ms/terminal-docs
Features
Multiple Terminal Types:
We can open powershell, command prompt, Azure cloud shell, bash. You can add custom prompt from the settings by creating a new profile. I added the powershell 7 using this method.
Multiple Tabs
Multiple tabs of different types. Helps especially with Docker and JSS development. I personally use a tab for docker, JSS application and Typescript compilation.
Multiple Panes
Multiple panes or split view helps to view all at once.
Rich Themes
The Windows Terminal uses a GPU accelerated text rendering engine. You can have themes and background image and effects.
I personally liked this prompt with Git support following Scott post
Execute the following command in powershell.
Open Run prompt and execute notepad $PROFILE
and add the following code save the file.
Download and install font Cascadia Code PL
https://github.com/microsoft/cascadia-code/releases
Set the font in Settings > Defaults > Appearance > Font face
If you don't see the defaults in the settings. Open JSON file in the settings and add the defaults section to the profiles. This will apply to all the terminal windows.
Please close all the windows terminal and reopen for the settings to take effect.
Tips and Tricks
How to open ?
- Click start and type wt
- Run prompt wt
- Pin to taskbar
Shortcuts
Ctrl+Shift+T
New tab
Ctrl+Shift+W
Close a tab
Ctrl+Tab or Ctrl+Alt+1
Switch between tabs. Tab number in place of 1 to shift between tabs
Ctrl+Shift+Tab
Switch tab backwards
Ctrl+Shift+P
Open command window
Alt+Shift+D
Create a new pane
Alt+Left, Alt+Right, Alt+Down, Alt+Up
Move pane focus
Alt+Shift+Left, Alt+Shift+Right, Alt+Shift+Down, Alt+Shift+Up
Resize pane
Issues
Issue 1:
error 0x800700c1 when launching 'C:\Program Files (x86)\PowerShell\7\pwsh.exe'
Solution
Check if there is file named program in C:\ drive rename or remove that file.
Issue 2:
When you open the Azure cloud shell you will encounter the following
Solution
Open the browser and authenticate for azure login.
Ref:
https://www.hanselman.com/blog/how-to-make-a-pretty-prompt-in-windows-terminal-with-powerline-nerd-fonts-cascadia-code-wsl-and-ohmyposh
https://www.thomasmaurer.ch/2019/08/how-to-open-windows-terminal-from-command-prompt-or-run/
Subscribe to Bala Blog | Sitecore MVP | Coveo MVP | DX MVP | Sitecore | Coveo | Microsoft
Get the latest posts delivered right to your inbox