How to change the integrated terminal in visual studio code or VSCode
Solution 1:
To change the integrated terminal on Windows, you just need to change the terminal.integrated.shell.windows
line:
- Open VS User Settings (Preferences > User Settings). This will open two side-by-side documents.
- Add a new
"terminal.integrated.shell.windows": "C:\\Bin\\Cmder\\Cmder.exe"
setting to the User Settings document on the right if it's not already there. This is so you aren't editing the Default Setting directly, but instead adding to it. - Save the User Settings file.
You can then access it with keys Ctrl+backtick by default.
Solution 2:
It is possible to get this working in VS Code and have the Cmder terminal be integrated (not pop up).
To do so:
- Create an environment variable "CMDER_ROOT" pointing to your Cmder directory.
- In (Preferences > User Settings) in VS Code add the following settings:
"terminal.integrated.shell.windows": "cmd.exe"
"terminal.integrated.shellArgs.windows": ["/k", "%CMDER_ROOT%\\vendor\\init.bat"]
Solution 3:
I know is late but you can quickly accomplish that by just typing Ctrl + Shift + p and then type default, it will show an option that says
Terminal: Select Default Shell
, it will then display all the terminals available to you.
Solution 4:
From Official Docs
Correctly configuring your shell on Windows is a matter of locating the right executable and updating the setting. Below is a list of common shell executables and their default locations.
There is also the convenience command Select Default Shell that can be accessed through the command palette which can detect and set this for you.
So you can open a command palette using ctrl+shift+p
, use the command Select Default Shell, then it displays all the available command line interfaces, select whatever you want, VS code sets that as default integrated terminal for you automatically.
If you want to set it manually find the location of executable of your cli and open user settings of vscode(ctrl+,
) then set
"terminal.integrated.shell.windows":"path/to/executable.exe"
Example for gitbash on windows7:
"terminal.integrated.shell.windows":"C:\\Users\\stldev03\\AppData\\Local\\Programs\\Git\\bin\\bash.exe",
Solution 5:
For OP's terminal Cmder
there is an integration guide, also hinted in the VS Code docs.
If you want to use VS Code tasks and encounter problems after switch to Cmder
, there is an update to @khernand's answer. Copy this into your settings.json
file:
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.env.windows": {
"CMDER_ROOT": "[cmder_root]" // replace [cmder_root] with your cmder path
},
"terminal.integrated.shellArgs.windows": [
"/k",
"%CMDER_ROOT%\\vendor\\bin\\vscode_init.cmd" // <-- this is the relevant change
// OLD: "%CMDER_ROOT%\\vendor\\init.bat"
],
The invoked file will open Cmder
as integrated terminal and switch to cmd
for tasks - have a look at the source here. So you can omit configuring a separate terminal in tasks.json
to make tasks work.
Starting with VS Code 1.38, there is also "terminal.integrated.automationShell.windows"
setting, which lets you set your terminal for tasks globally and avoids issues with Cmder
.
"terminal.integrated.automationShell.windows": "cmd.exe"