5 tips for an awesome Windows Terminal experience
If you aren't already using the new Windows Terminal, then I recommend installing it and trying it out.
The team have recently released v0.11, which will be the last major version before v1.0 (I would take a guess that v1.0 will announced at Microsoft Build 2020).
You can install it either through the Windows Store (recommended), manually via the GitHub release artifacts, or if you use Chocolately, then there is an unofficial Chocolatey package (choco install microsoft-windows-terminal
).
In this post, I will list out 5 tips for improving the already-great Windows Terminal experience:
- Customize the background
- Use the multi-pane shortcuts
- Customize the start-up layout
- Open the Terminal at the current directory
- Customize key bindings
(Many of these tips require editing the settings, which you can do by opening the settings.json
file; either through the pull-down menu at the top of the application, or by using the ctrl + ,
keyboard shortcut.)
Customize the background
Windows Terminal supports setting custom backgrounds on your profiles. You can specify an image either via a URL or a local file path, and also set the opacity and stretch/alignment preferences for the image.
It also supports animated gifs, if you are so inclined.
Scott Hanselman even wrote a fun post around how to dynamically update the background to produce reaction gifs for specific commands.
Use the multi-pane shortcuts
Windows Terminal has support for using split panes inside a tab. Currently, the only way to use this feature is via the keyboard shortcuts (you can customize these though - see Customize key bindings section).
You can open a new pane either to the right using alt + shift + =
, or to the bottom using alt + shift + -
. Note, the profile that opens in the new pane will always be the whatever you have set as your default profile.
To resize the panes, use alt + shift + <arrow key>
to resize in the direction of the arrow key used.
You can select each pane either by clicking it, or you can use the alt + <arrow key>
shortcut to move the focus between the panes, in the direction of the arrow key.
Finally, to close a pane, you can use the ctrl + shift + w
shortcut.
Customize the start-up layout
When you open up Windows Terminal, by default it will open up a single tab with a single pane, using your default profile. However, if you wish to customize this start-up layout, you can use the wt
with command line arguments.
Installing Windows Terminal adds wt
to the system path, so you can invoke it without having to specify the fully qualified path. On it's own, wt
will start up a new instance of Windows Terminal, but it also has sub-commands for split-pane
and new-tab
, which allow you to set up the layout how you like.
The split-pane
and new-tab
commands both take a -p
parameter which allows you to specify the the type of profile you want to open, referenced either by name or guid (you can find these in the settings.json
file), and a -d
parameter if you want to override the starting directory. Additionally, for split-pane
you can specify -H
or -V
to split the pane horizontally or vertically.
You can use a ;
in the command to string multiple sub-commands together. For instance:
If you want to open with focus on a different tab, you can add the focus-tab
sub-command with the -t
parameter to specify the tab number (tab numbers start at 0).
Full details about using the command line arguments can be found in the GitHub docs.
You can create a new Windows shortcut with your command and pin it to the taskbar to make it easier to use. Right click in File Explorer, and select New -> Shortcut. In the Properties window that opens, on the Shortcut tab you can enter the required command in the Target field.
If you wish, you can also change the icon here, using the 'Change Icon...' button.
Once done, click OK, then right-click the file and select Pin to Taskbar. Now you can quickly open up your favourite Terminal layout from the taskbar.
Open the Terminal at the current directory
If you are used to opening up cmd or PowerShell in the current directory by typing in cmd
or pwsh
into the address bar in File Explorer, then you may expect the same to work with wt
.
However, this is not the case - it will open up to your default user directory. But you can get around this using the -d
flag for wt
to specify the current directory, e.g.
wt -d .
Customize key bindings
All of the key bindings in Windows Terminal (such as the split pane shortcuts shown in previous tip) are customizable.
You can customize them by adding a keybindings
array to the settings.json
file. If you have the settings schema set on the file and are using an IDE such as VS Code, then you will get intellisense as you fill it in, showing you the available bindings. For each item in the array, you specify the command
and the keys
for the binding (note you can have more than one set of key combinations for the same command).
The full list of commands and modifiers and keys you can use for the bindings can be found on GitHub in the settings schema documentation.
Also note that since the latest release, some commands can be specified as objects instead of simple strings, e.g.
More information about these commands can be found in the blog post for the v0.11 release.