Vscode 将终端改为 Git bash
在Windows环境下使用 Visual Studio Code ,其控制台终端默认是使用的 Cmd

当然你也可以设置为Windows PowerShell

但是对于习惯使用Linux操作命令的同学来说,可能不太喜欢用 Cmd 和 PowerShell 这种终端操作。
下面我们把Vscode的终端改为 bash ,本文是使用的安装Git时自带的那个bash.exe
第一步,找到你安装Git的目录,在bin目录下有个bash.exe,复制bash的地址,比如:C:\Program Files\Git\bin\bash.exe

bin目录下面的bash.exe,就是我们要用到的。
第二步,打开Vscode, 点击左下角【设置】

第三步,在打开的设置面板中,搜索框内搜索 Shell: Windows ,找到这一项:Terminal › Integrated › Shell: Windows(应该是搜索结果的第一项)如下图所示:

将该项输入框内容替换为上面复制的bash.exe的地址,重启Vscode ,打开控制台终端,此时终端变成了我们喜欢的 bash 窗口了:

作者:koowave
链接:https://www.jianshu.com/p/efa734089206
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。