Customizing the VSCode Integrated Terminal Shell – A Practical Guide
Customize VSCode's integrated terminal shell with a single setting, verify the change, and manage extension compatibility.
08 Oct 2026, 03:54 UTC

Why the terminal shell matters in VSCode
Developers open a new terminal inside VSCode expecting it to behave like the shell they use outside the editor. When the default shell differs, commands may fail, path expansions can be surprising, and scripts that rely on specific environment variables can break. The core issue is that VSCode automatically selects a shell based on the operating system, and that choice propagates to the code . command, the integrated terminal, and even the debug console.
How VSCode auto-detects the default shell
On Windows, the built‑in detection prefers PowerShell (or cmd when PowerShell is unavailable). On macOS, it falls back to the first available Bourne‑compatible shell, typically bash or zsh. The detection logic looks for the executable in the system PATH and uses the first match it finds. This automatic choice works for most users, but it can be problematic when a team standardizes on a different interpreter, such as zsh on macOS or git‑bash on Windows.
Customizing the default shell with a setting
VSCode exposes the terminal.integrated.defaultShell setting in its JSON configuration. The value must be an absolute path to the desired executable, bypassing the OS detection entirely. For example, on a macOS machine you can force the terminal to use zsh by setting:
"terminal.integrated.defaultShell": "/bin/zsh"
On Windows you might point to a Git‑installed Bash:
"terminal.integrated.defaultShell": "C:\\Program Files\\Git\\bin\\bash.exe"
After editing the setting, a restart of VSCode is required for the change to take effect in all new terminals, including those launched via the code . command or the debug console.
It is important to note that the setting accepts only absolute paths; relative paths are rejected and will cause a validation error. Editing the workspace settings file requires write permission for the folder, while the user‑level settings.json may need administrator rights on some systems.
Worked example: forcing zsh on a macOS machine
- Open the Command Palette with Ctrl+Shift+P (or Cmd+Shift+P on macOS) and run
Preferences: Open Settings (JSON). - Add the following line to the JSON object, ensuring commas are correct:
- Save the file and restart VSCode (or press Ctrl+Shift+P →
Developer: Reload Window). - Open a new terminal (
Ctrl+`) and runecho $SHELL. The output should be/bin/zsh, confirming the new default. - To verify that project scripts are also using zsh, open a folder that contains a
package.jsonwith ascriptsentry, then runnpm run. The terminal that launches will inherit the zsh environment. - If the change proves undesirable, replace the path with the original default (e.g.,
/bin/bash) and reload the window. The terminal will revert to the previous shell without affecting existing files.
"terminal.integrated.defaultShell": "/bin/zsh"
Verification checks include confirming the shell name via echo $SHELL (macOS/Linux) or echo %USERPROFILE% (Windows) and observing that the terminal title reflects the selected interpreter.
Trade‑off and limitation: extensions that assume a specific shell
Changing the default shell can break extensions that hard‑code assumptions about the environment. For instance, an extension that parses PATH entries expecting PowerShell syntax may fail when the terminal runs zsh. The caution in the research notes warns that such extensions may become unstable. To mitigate risk, test the change on a non‑critical machine first, or keep a secondary shell available via the Select Default Shell command (available in recent VSCode releases) which lets you pick a shell without editing JSON.
Actionable closing: steps to safely customize your terminal
- Identify the shell you want to use (e.g.,
zsh,bash,git‑bash). - Locate the absolute path to the executable. On macOS, run
which zshin an existing terminal; on Windows, usewhere bash.exefrom a command prompt. - Open
Settings (JSON)via the Command Palette and add theterminal.integrated.defaultShellentry with the path you discovered. - Restart VSCode and open a new terminal. Run a simple command like
echo $0(orecho %COMSPEC%on Windows) to confirm the shell name. - If an extension misbehaves, either revert the setting or use the
Select Default Shellcommand to switch temporarily.
By following these steps you can align the integrated terminal with your preferred workflow while staying aware of the potential impact on extensions and project scripts. The ability to force a specific interpreter gives you full control, but always verify the result after each change.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.