I want to change integrated terminal to CMDER
i use Vscode on windows 8.1
i checked the doc and also preference file but i got confuse
so from following lines which line will change it
// External Terminal
// Customizes which terminal to run on Windows.
"terminal.external.windowsExec": "%COMSPEC%",
// Customizes which terminal application to run on OS X.
"terminal.external.osxExec": "Terminal.app",
// Customizes which terminal to run on Linux.
"terminal.external.linuxExec": "xterm",
// Integrated Terminal
// The path of the shell that the terminal uses on Linux.
"terminal.integrated.shell.linux": "sh",
// The command line arguments to use when on the Linux terminal.
"terminal.integrated.shellArgs.linux": [],
// The path of the shell that the terminal uses on OS X.
"terminal.integrated.shell.osx": "sh",
// The command line arguments to use when on the OS X terminal.
"terminal.integrated.shellArgs.osx": [],
// The path of the shell that the terminal uses on Windows. When using shells shipped with Windows (cmd, PowerShell or Bash on Ubuntu), prefer C:\Windows\sysnative over C:\Windows\System32 to use the 64-bit versions.
"terminal.integrated.shell.windows": "C:\\Windows\\system32\\cmd.exe",
// The command line arguments to use when on the Windows terminal.
"terminal.integrated.shellArgs.windows": [],
// Controls the font family of the terminal, this defaults to editor.fontFamily's value.
"terminal.integrated.fontFamily": "",
// Controls whether font ligatures are enabled in the terminal.
"terminal.integrated.fontLigatures": false,
// Controls the font size in pixels of the terminal, this defaults to editor.fontSize's value.
"terminal.integrated.fontSize": 0,
// Controls the line height of the terminal, this number is multipled by the terminal font size to get the actual line-height in pixels.
"terminal.integrated.lineHeight": 1.2,
// Controls whether the terminal cursor blinks.
"terminal.integrated.cursorBlinking": false,
// Controls whether locale variables are set at startup of the terminal, this defaults to true on OS X, false on other platforms.
"terminal.integrated.setLocaleVariables": false,
// A set of command IDs whose keybindings will not be sent to the shell and instead always be handled by Code. This allows the use of keybindings that would normally be consumed by the shell to act the same as when the terminal is not focused, for example ctrl+p to launch Quick Open.
"terminal.integrated.commandsToSkipShell": [
"editor.action.toggleTabFocusMode",
"workbench.action.debug.continue",
"workbench.action.debug.restart",
"workbench.action.debug.run",
"workbench.action.debug.start",
"workbench.action.debug.stop",
"workbench.action.quickOpen",
"workbench.action.showCommands",
"workbench.action.terminal.clear",
"workbench.action.terminal.copySelection",
"workbench.action.terminal.focus",
"workbench.action.terminal.focusNext",
"workbench.action.terminal.focusPrevious",
"workbench.action.terminal.kill",
"workbench.action.terminal.new",
"workbench.action.terminal.paste",
"workbench.action.terminal.runSelectedText",
"workbench.action.terminal.scrollDown",
"workbench.action.terminal.scrollDownPage",
"workbench.action.terminal.scrollToBottom",
"workbench.action.terminal.scrollToTop",
"workbench.action.terminal.scrollUp",
"workbench.action.terminal.scrollUpPage",
"workbench.action.terminal.toggleTerminal"
],
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.
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"]
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.
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",
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"
Probably it is too late but the below thing worked for me:
- Open Settings --> this will open settings.json
- type terminal.integrated.windows.shell
- Click on {} at the top right corner -- this will open an editor where this setting can be over ridden.
- Set the value as
terminal.integrated.windows.shell: C:\\Users\\<user_name>\\Softwares\\Git\\bin\\bash.exe
- Click Ctrl + S
Try to open new terminal. It should open in bash editor in integrated mode.
来源:https://stackoverflow.com/questions/40487445/how-to-change-the-integrated-terminal-in-visual-studio-code-or-vscode