2017-09-08 54 views
0

每當我在Visual Studio代碼中打開終端時,我都會得到一個bash shell。我想添加CMD作爲第二個shell。要做到這一點,我通過VS Code文檔,發現這個命令:在Visual Studio代碼終端中打開CMD

ctrl+shift+` 

但它只打開第二個bash shell。在集成終端中打開CMD是否有快捷方式,而不是在外部控制檯中打開它?

回答

1

如果你想一直開CMD,您可以使用設置來配置。

docs

正確配置您的Windows外殼定位是正確的可執行文件和更新設置的問題。 下面是常見的殼可執行文件及其默認位置的列表:

// 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

如果您經常使用這兩種方法,您可能需要使用一個擴展名,如thisthis,它允許您在啓動時選擇終端。

鍵綁定:

[{ 
    "key": "ctrl+shift+t", 
    "command": "shellLauncher.launch" 
    }] 

設置:

{ 
    "shellLauncher.shells.windows": [ 
     { 
     "shell": "bash", 
     "args": [], 
     "label": "bash" 
     }, { 
     "shell": "cmd", 
     "args": [], 
     "label": "cmd" 
     } 
    ] 
    } 
相關問題