For convenience, I might refer to Windows Terminal as just WT in places throughout this page.
Settings File
You can open your settings file to edit it by using the in-app menu (Menu -> Settings
)
Intellisense / Schema Support
Depending on how long ago you installed Windows Terminal, and when it was last updated, your JSON probably has a root field that looks like this:
{
"$schema": "https://aka.ms/terminal-profiles-schema"
}
This is a URL to a JSON schema, which certain IDEs, like VSCode, can parse and use to provide type-checking and intellisense / autocomplete while you edit the settings.
If your file is missing this field, I highly recommend adding it back so you can get better validation support.
Using with Cmder / ConEmu
If you want Cmder / ConEmu as the pseudo-shell within WT, you can create an entry for it under profiles
. For example, here is my entry for Cmder
:
{
"name": "Cmder",
"hidden": false,
"commandline": "C:\\laragon\\bin\\cmder\\Cmder.bat %projects%",
"icon": "λ"
}
Automating Commands and Calling Programs
In addition to key bindings for WT actions, like opening a new tab, you can also setup bindings for essentially any command you would normally type into the console. By using the sendInput
action type, you can have WT send input into a shell, just as if you had typed it.
Here is an example, calling the path of a script to refresh the current shell variables (getting around stale setx
values):
// Useful for after using `setx`, etc.
{
"name": "Refresh Environment Variables",
"icon": "🔄",
"command": {
"action": "sendInput",
"input": "\"C:\\ProgramData\\chocolatey\\bin\\RefreshEnv.cmd\"\n"
},
"keys": "f5"
}
Note: You will see that special care has to be taken to escape quotes, as well as slashes.
Troubleshooting / FAQs
- When copying wrapped text, newlines / line breaks end up in the clipboard text
- Input has stopped appearing as you type it
- This is actually an issue with terminals in general, and can happen for a number of reasons. The quick fix is usually to use
reset
orstty sane
.
- This is actually an issue with terminals in general, and can happen for a number of reasons. The quick fix is usually to use