For an overview of all types of shells used in Visual Studio Code, see this answer.
Custom shell profiles are maintained in the settings.json
file; to open it for editing, select Preferences: Open Settings (JSON)
from the command palette (Ctrl-Shift-P).
There are platform-specific properties named terminal.integrated.profiles.*
, where *
is either windows
, linux
, or osx
(macOS).
The properties inside each define shell profiles, i.e. the shells available for running in the integrated terminal via the dropdown menu labeled +
(
).
Each shell-profile definition:
At a minimum requires either a path
argument specifying the full path to the shell executable or, on Windows only, a source
argument, which can be PowerShell
or Git Bash
to let VS Code find the appropriate executables.
Start-up arguments are specified via args
.
For all supported properties, see the docs.
To set the default shell profile:
Either: use the Terminal: Select Default Profile
command from the command palette: a list of all defined profiles will present; select the one of interest.
- Note: Clicking the cog icon (
) to the right of each profile allows you to define a new profile that is a based on the highlighted one: You're prompted for a name for the new profile, which is then created as a copy of the highlighted profile. Note that no further action is taken as of v1.59 - you must manually open the settings.json
file for editing in order to customize the new profile.
Or: Set the platform-appropriate terminal.integrated.defaultProfile.*
property to the name of the desired shell profile.
Example: Defining Node.js (node.exe
) as a custom shell profile on Windows:
- Determine the full path to
node.exe
and escape \
characters for JSON by doubling them; e.g., from PowerShell:
# Get node.exe's full path, escape '\' chars., copy to the clipboard.
(Get-Command node.exe).Path.Replace('\', '\\') | Set-Clipboard
- Add the following to your
settings.json
file (if the terminal.integrated.profiles.windows
property already exists, simply add the Node.js
property to it); the example uses node.exe
's default installation location, C:\Program Files\nodejs\node.exe
.
"terminal.integrated.profiles.windows": {
"Node.js": {
"path": "C:\\Program Files\\nodejs\\node.exe",
"args": [] // Add startup arguments as needed.
}
},
// Make Node.js the default shell (if the property already exists, update its value).
"terminal.integrated.defaultProfile.windows": "Node.js",