設置文件:
setting.json
html
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe", "terminal.integrated.env.windows": {"CMDER_ROOT": "D:\\GreenTools\\cmder"}, "terminal.integrated.shellArgs.windows": ["/k", "D:\\GreenTools\\cmder\\vendor\\init.bat"],
其中,D:\GreenTools\cmder 爲 cmder 的自定義安裝目錄。git
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
插件:Shell launchergithub
在 Files->Preferences->Settings 中,編輯 settings.json
文件。
添加以下配置:json
Windows 的配置:windows
"shellLauncher.shells.windows": [ { "shell": "C:\\WINDOWS\\System32\\cmd.exe", "label": "cmd" }, { "shell": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "label": "PowerShell" }, { "shell": "D:\\Program Files\\Git\\bin\\bash.exe", "label": "Git bash" }, ],
以上路徑替換爲實際電腦上的路徑。bash
設置 vs code 的快捷鍵,刪除原來的 Ctrl + Shift + ``
對應的打開終端方式,將 shellLauncher.launch
映射到此快捷鍵上。插件
最終效果:
在按下快捷鍵 Ctrl + Shift + ``
時,會彈出菜單,讓你選擇須要打開的終端類型。code