23

I have set my integrated default terminal in VSCode as Git Bash but whenever I launch VSCode, powershell pops up instead of bash. It does not, however, change the default terminal setting but it is irritating. I have tried removing the profile of powershell from settings but that seems to do nothing. Why is this happening?

Abhishek Ghadge
  • 425
  • 3
  • 13

6 Answers6

12

Make sure you upgrade to vscode v1.60.1 - there is a fix in that point release for this issue.


See Select Default Profile do not actually open gitbash. After relaunch, on startup, it just keeps open PowerShell.

The same thing was happening to me and the referred to fix in the Insiders' Build 05/14/2021 did in fact fix it for me. In the meantime, opening another terminal does always open git bash for me - but that is a pain.

Mark
  • 143,421
  • 24
  • 428
  • 436
2

This worked for me:

{
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "terminal.integrated.profiles.windows": {
        "PowerShell": null,
        "Git Bash": {
            "source": "Git Bash"
        },
        "Windows PowerShell": null
    },
    "terminal.integrated.automationShell.windows": "Git Bash",
    "powershell.enableProfileLoading": false,
    "powershell.integratedConsole.showOnStartup": false
}
Abhishek Ghadge
  • 425
  • 3
  • 13
  • Where do you then set path to Git Bash (`"path": "C:\\Program Files\\Git\\bin\\bash.exe"`)? – s3c Sep 16 '21 at 07:05
  • The vscode will detect the install of shell defined in ```"terminal.integrated.profiles.windows" ```, if not you can directly add the source directly as the value of source. Refer: https://code.visualstudio.com/docs/editor/integrated-terminal#_configuring-profiles – Abhishek Ghadge Oct 09 '21 at 08:03
1

I managed to find a workaround without using the Insider's Build that may work for some of you : I removed all profiles safe for the one I want, and reinstalled VS Code. Then it somehow started using the right terminal on startup. I don't know if this works without disabling all other profiles though.

SeizeD
  • 11
  • 1
1

I was still having this issue, and what worked for me was:

  1. When PowerShell opened, I reset GitBash to my default, and then killed the terminal (so there were no terminal's running).
  2. Removed the terminal panel from view by clicking the X in the top right
  3. Closed VSCode
  4. When I opened my codebase again and showed the terminal, it began working.
kea
  • 75
  • 9
  • 4
    It seems to be a very bad bug. I have tried what you mentioned and it works for awhile and then goes back to Powershell eventually. – Mark Sep 05 '21 at 19:32
  • 1
    So far my above fix hasn't stopped working yet, but I will keep the answer updated if it does. I agree with you, a very bad bug is a good summary. – kea Sep 06 '21 at 20:23
  • 2
    Still seeing this in 1.60 but I never had an problem prior to this version. Have removed all profiles except `Git Bash`, still powershell appears on opening VSCode if I leave the terminal panel open when closing. – Greg K Sep 09 '21 at 08:12
  • 2
    Same for me, I can't prevent it from launching Powershell first no matter what I do. – Sam Tolton Sep 14 '21 at 09:04
  • Since 1.60 for me as well. – s3c Sep 16 '21 at 07:07
1

This looks like an ongoing issue that is still not fixed in the current version (1.60.0).


This is now fixed in my current version (1.61.1).

Sam Tolton
  • 347
  • 6
  • 14
1

Just did an update to version 1.60.1 and it fixed it.

From the release notes the bug was addressed and has since been merged.

Update 1.60.1: The update addresses these issues

MrKudu
  • 41
  • 3
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/29841729) – Lex Lustor Sep 16 '21 at 13:59
  • @LexLustor Please explain how to elaborate on "I updated to version 1.60.1 and that fixed it". – Scratte Sep 17 '21 at 08:16
  • 1
    @Scratte I was refering to the fact that the content of the link could be summarized in MrKudu answer, pointing that a PR adressing the bug as been merged in the version 1.60.1 of VS Code, effectively solving the problem (not just 'seems'). Thanks for pointing my original comment : your comment makes mine a rather "pedantic" one. – Lex Lustor Sep 17 '21 at 09:27
  • 1
    @LexLustor will keep that in mind for next time. – MrKudu Sep 17 '21 at 14:23