How do I use Bash on Windows from the Visual Studio Code integrated terminal?

前端 未结 17 1844
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 00:28

Visual Studio Code on Windows uses PowerShell by default as the integrated terminal. If you want to use Bash from Visual Studio Code, what steps should be followed?

17条回答
  •  一生所求
    2020-11-28 00:42

    It depends on whether you have installed Git Bash in the current user only or all users:

    If it is installed on all users then put "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe" in your User Settings (Ctrl + Comma).

    If it is installed on only the current user then put "terminal.integrated.shell.windows": "C:\\Users\\\\AppData\\Local\\Programs\\Git\\bin\\bash.exe" in your User Settings (Ctrl + Comma).

    If the methods listed above do not work then you should try Christer's solution which says -

    If you want the integrated environment you need to point to the sh.exe file inside the bin folder of your Git installation.

    So the configuration should say C:\\\\bin\\sh.exe.

    Note: The sh.exe and bash.exe appear completely same to me. There should be no difference between them.

提交回复
热议问题