2017-06-08 27 views
4

我查看了this鏈接,其中談到了在Visual Studio代碼集成終端中更改默認命令行shell。我成功地使用下面的設置在settings.json文件中將其更改爲Git Bash。如何在Visual Studio代碼集成終端中使用多種類型的命令行shell

{ 
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe" 

} 

有與幫助,您可以有平行運行多個終端如下面的截圖集成終端+標誌:您可以通過按Ctrl + ,組合鍵或File -> Preferences -> Settings菜單打開settings.json文件

enter image description here

所以我想實現的是裝載的Git的Bash shell在終端#1和Windows PowerShell中的終端#2,依此類推。實現相同的配置有什麼相關的配置?

回答

2

在最近的版本(1.15.0),您可以

  • 更改設置,然後運行終端,您已設置
  • 然後再次更改設置並按運行另一種類型的終端在+標誌
  • 等等...

你可以把這個在你的設置文件,並取消你需要哪一個。

// 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" 
+0

Ohh .. interesting。事實上,你的建議是在VS代碼的老版本中工作,例如1.9。我剛纔測試了它。我一直認爲這是一個單一的配置,我從來沒有想過在更改配置後點擊'+'符號。相反,我曾經重新啓動Visual Studio代碼以查看配置更改在終端中生效。精彩的回答! – RBT

相關問題