visual-studio-codegit-bash

Windows Visual Studio Code terminal takes about 5 seconds to return to the command prompt after pressing Enter


I have tried all of the following:

Whenever I press Enter in the terminal, it takes nearly five seconds to return to the command prompt.

I think this problem began when I had Docker running in the background and there was some lag and I hit Enter several times to put space between my last failed test. Now it's always taking so long. I am using Git Bash as my terminal. Git Bash terminal outside of Visual Studio Code is fast.

Why is Visual Studio Code using Git Bash as the terminal suddenly really slow?


Solution

  • OK, I solved the problem. I am not sure why it went weird in the first place, but this is it:

    1. Backup Visual Studio Code settings.json and make a note of extensions installed

    2. Uninstall Visual Studio Code

    3. Uninstall Git Bash. It removes C:\Program Files\Git

    4. Delete all contents:

      • C:\Users\steve\AppData\Roaming\Code
      • C:\Users\steve.vscode
      • C:\Users\steve\AppData\Local\Programs\Microsoft VS Code
    5. Instal Git Bash with Unix options, etc.

    6. Install Visual Studio Code

      • settings.json

        C:\Users\steve\AppData\Roaming\Code\User\settings.json

          "terminal.integrated.profiles.windows": {
            "GitBash": { "path": "C:\\Program Files\\Git\\bin\\bash.exe", "icon": "terminal-bash" }
          },
          "terminal.integrated.defaultProfile.windows": "GitBash",
          "terminal.integrated.rendererType": "auto",
          "terminal.integrated.allowChords": false,
          "terminal.integrated.drawBoldTextInBrightColors": false,
          "terminal.integrated.experimentalLinkProvider": false,
          "terminal.integrated.gpuAcceleration": "off",
        
      • install extensions

      • add the folder to project IMPORTANT

      • cd to the folder

    Now the terminal is super fast!!!