Today, I opened VSCode to prepare for the manual code. When I opened the terminal, I found that the bash previously configured could not be used, only PowerShell and Command Prompt. This makes people very uncomfortable, so I searched the Internet, but unfortunately they are some old sesame seeds rotten millet, none of them can be used.

We are in the original “terminal. Integrated. Shell. Windows” to configure the terminal, but in April 2021 have abandoned the fields, Now want to use the latest “terminal. Integrated. Profiles. Windows” to configuration, the configuration is as follows:

// setting.json
{
    // Terminal configuration
  "terminal.integrated.profiles.windows": {
    "PowerShell": {
      "source": "PowerShell"."icon": "terminal-powershell"
    },
    "Command Prompt": {
      "path": [
        "${env:windir}\\Sysnative\\cmd.exe"."${env:windir}\\System32\\cmd.exe"]."icon": "terminal-cmd"
    },
    "GitBash": {
      "path": ["C:\\Program Files\\Git\\bin\\bash.exe"]."icon": "terminal-bash"}},"terminal.integrated.defaultProfile.windows": "GitBash",}Copy the code

Detailed steps:

  1. Open Settings

  1. Search in the search box: terminal. Integrated. Profiles. The Windows

  1. Click below: Edit in Settings. json to enter the settings.json file

    Then write in the terminal configuration, and see Step 4.

    Note:

    A. “terminal. Integrated. DefaultProfile. Windows” : “GitBash” after this one set, after will open a terminal, default to bash as terminal;

    B. Git Bash for your own computer.

  2. Finally, be sure to restart the VSCode editor, then open the terminal and try again.


Reference: dev to/andrewriver…