Configuring Windows Terminal: A Comprehensive Guide
Windows Terminal offers a highly customizable environment for developers and power users. This article dives deep into the various settings available, allowing you to tailor your terminal experience to your exact needs.
Understanding the Settings File
Windows Terminal stores its configuration in a JSON file, typically located at:
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
You can access this file directly or use the built-in settings UI in Windows Terminal (Ctrl+,
).
Key Configuration Areas
The settings.json
file is divided into several sections:
1. Defaults
The defaults
object contains settings that apply to all profiles unless overridden by a specific profile. This is a great place to set global preferences like the default font, color scheme, or starting directory.
Example: Default Settings
{
"defaultProfile": "{00000000-0000-0000-0000-000000000000}",
"launchMode": "default",
"theme": "system",
"defaultLocale": "en-US",
"copyFormatting": "all",
"actions": [
{ "command": {"action": "copy", "copyFormatting": "text"} },
{ "command": {"action": "paste"} }
],
"profiles": {
"defaults": {
"font": {
"face": "Cascadia Mono",
"size": 11
},
"cursorShape": "filledBox",
"colorScheme": "Campbell"
},
"list": []
}
}
2. Profiles
The profiles
object contains the list
of all your configured shells (e.g., PowerShell, Command Prompt, WSL distributions). Each profile can have its own unique settings, overriding the defaults.
Each profile in the list
requires at least a guid
, name
, and commandline
. Common settings include:
guid
: A unique identifier for the profile.name
: The display name of the profile in the dropdown.commandline
: The executable to run (e.g.,powershell.exe
,wsl.exe -d Ubuntu
).icon
: Path to an icon file (e.g.,ms-appx:///ProfileIcons/{GUID}/...
or a local path).startingDirectory
: The directory where the shell will start.hidden
: Whether to hide the profile from the dropdown.
Example: A Custom PowerShell Profile
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"commandline": "pwsh.exe",
"icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}/powershell.png",
"startingDirectory": "%USERPROFILE%",
"historySize": 9001
}
3. Schemes
The schemes
array defines the color palettes available in Windows Terminal. You can define your own color schemes or import existing ones.
Each scheme has a name
and an array of colors
, mapping terminal ANSI color codes to hex color values.
Example: A Custom Color Scheme
{
"name": "My Custom Dark",
"cursorColor": "#FFFFFF",
"selectionBackground": "#264F78",
"background": "#1E1E1E",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3E96FF",
"brightCyan": "#64D5EA",
"brightGreen": "#3DF272",
"brightPurple": "#B220F2",
"brightRed": "#F8005A",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFF300",
"cyan": "#00A3A3",
"green": "#00C400",
"purple": "#790093",
"red": "#DE0000",
"white": "#CCCCCC",
"yellow": "#D9A400"
}
Actions and Key Bindings
The actions
array allows you to define custom key bindings for various terminal commands. This is incredibly powerful for streamlining your workflow.
Common actions include:
copy
,paste
find
openTab
,closeTab
splitPane
(to create new panes)newTabProfile
(to open a new tab with a specific profile)sendInput
(to send raw text to the shell)
Example: Custom Key Bindings
{
"command": { "action": "splitPane", "split": "auto", "confirm": true },
"keys": "alt+shift+d"
},
{
"command": { "action": "newTabProfile", "profile": "{00000000-0000-0000-0000-000000000000}" },
"keys": "ctrl+alt+t"
}
Further Customization
Explore the official Windows Terminal documentation for more advanced settings, including:
- Customizing the terminal bell
- Setting up dynamic profiles
- Integrating with other tools
By carefully configuring your settings.json
, you can transform Windows Terminal into a highly efficient and personalized command-line interface.