vin*_*c4f 9 cmd visual-studio-code
每当我在Visual Studio Code中打开终端时,我都会得到一个bash shell.我想将CMD添加为第二个shell.为此,我查看了VS Code文档并找到了以下命令:
CTRL+ SHIFT+`
但它只打开第二个bash shell.是否有在集成终端中打开CMD的快捷方式,而不是在外部控制台中打开它?

小智 18
Lle*_*wey 12
如果要始终打开cmd,可以使用设置进行配置.
来自文档:
在Windows上正确配置shell需要找到正确的可执行文件并更新设置.以下是常见shell可执行文件及其默认位置的列表:
Run Code Online (Sandbox Code Playgroud)// 64-bit cmd if available, otherwise 32-bit "terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\cmd.exe" // 64-bit PowerShell if available, otherwise 32-bit "terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe" // Git Bash "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe" // Bash on Ubuntu (on Windows) "terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"
如果您只想打开cmd,您可以简单地打开一个新的bash终端,然后cmd在其中运行.
如果你经常使用它们,你可能想要使用这样或这样的扩展,它允许你在启动时选择你的终端.
键绑定:
[{
"key": "ctrl+shift+t",
"command": "shellLauncher.launch"
}]
Run Code Online (Sandbox Code Playgroud)
设置:
{
"shellLauncher.shells.windows": [
{
"shell": "bash",
"args": [],
"label": "bash"
}, {
"shell": "cmd",
"args": [],
"label": "cmd"
}
]
}
Run Code Online (Sandbox Code Playgroud)
小智 8
在用户设置上添加此 注意:粘贴在顶部
{
"terminal.integrated.shell.windows": "cmd.exe"
// other settings...
}
Run Code Online (Sandbox Code Playgroud)
小智 5
您可以将当前终端更改为您需要(或拥有)的任何终端。
或者您可以使用Ctrl + Shift + P打开命令面板并输入Terminal Profile,然后更改默认配置文件。
这将更改您的启动终端。如果您启动一个新终端,默认终端将始终打开。
| 归档时间: |
|
| 查看次数: |
18235 次 |
| 最近记录: |