Reputation: 319
Whenever I open the terminal in Visual Studio Code, I get a bash shell. I want to add CMD as a second shell. To do that, I went through the VS Code documentation and found this command:
CTRL+SHIFT+`
But it only opens a second bash shell. Is there a shortcut for opening CMD in the integrated terminal, rather than opening it in an external console?
Upvotes: 31
Views: 83396
Reputation: 650
Upvotes: 35
Reputation: 116
You can change your current terminal to whatever you need (or have).
Or you can use Ctrl + Shift + P to open the Command Palette and type Terminal Profile, then change the default profile.
This will change your startup terminal. If you start a new one, the default terminal will always open.
Upvotes: 5
Reputation: 1
If you want to open another CMD terminal, from the VS Code terminal or any other terminal, use
@start run cmd .
or when you want to go on dir above and open cmd there:
cd .. & @start cmd .
Upvotes: 0
Reputation: 420
I don't know why anyone else hasn't mentioned it yet, but here's the simplest way to open CMD in VSCode.
Just type CMD in the terminal and hit enter.
Upvotes: 9
Reputation: 9242
If you want to always open cmd, you can use the settings to configure that.
From the docs:
Correctly configuring your shell on Windows is a matter of locating the right executable and updating the setting. Below are a list of common shell executables and their default locations:
// Command Prompt
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
// PowerShell
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
// Git Bash
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\git-cmd.exe",
"terminal.integrated.shellArgs.windows": [
"--command=usr/bin/bash.exe",
"-l",
"-i"
]
// Bash on Ubuntu (on Windows)
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\bash.exe"
If you want to only sometimes open cmd, you may be able to simply open a new bash terminal and then run cmd
in it.
If you use both frequently, you may want to use an extension like this or this which allow you to pick your terminal when you launch it.
Keybindings:
[{
"key": "ctrl+shift+t",
"command": "shellLauncher.launch"
}]
Settings:
{
"shellLauncher.shells.windows": [
{
"shell": "bash",
"args": [],
"label": "bash"
}, {
"shell": "cmd",
"args": [],
"label": "cmd"
}
]
}
Upvotes: 15
Reputation:
Add this on user setting Note: paste at top
{
"terminal.integrated.shell.windows": "cmd.exe"
// other settings...
}
Upvotes: 8
Reputation: 31
Just open the terminal and enter the link to your cmd application e.g C:\Windows\system32\cmd.exe
Upvotes: 3