25

Whenever I open terminal in VS Code it always opens it's default one, and I always have to manually change it.

enter image description here

This is really annoying because I use terminal all the time every day. I checked Terminal settings in the toolbar but I can not find the option to change default. How can we do it?

NeNaD
  • 18,172
  • 8
  • 47
  • 89

5 Answers5

31

When terminal is opened, in top right corner user should click on down-arrow button and then an option menu will appear. Then you should select Select Default Profile and you can choose your default terminal from there.

enter image description here

NeNaD
  • 18,172
  • 8
  • 47
  • 89
  • 1
    My default is showing as command prompt but it refuses to honor this, instead opeing powershell no matter what I do. – Nick H Sep 05 '21 at 14:21
7

There are a lot of issues on github about this, see, e,g, Default console changed from what I wanted to Powershell during upgrade ( I think that is oldest tracking one for the v1.60 release).

I can replicate the problem on the Stable v1.60 build but not on the Insiders' Build with the exact same settings.

So it isn't your set-up and I'm sure the vscode team is aware of it. Your options are to

(1) use the Insiders' Build - at least that works for me,
(2) downgrade vscode to v1.59,
(3) when I click the Add Terminal + button I do get my default Git Bash terminal, or
(4) rename your default profile - see below.

FYI, my settings:

  "terminal.integrated.profiles.windows": {
    "PowerShell": {
      "source": "PowerShell",
      "icon": "terminal-powershell"
    },
    "Command Prompt": {
      "path": [
        "${env:windir}\\Sysnative\\cmd.exe",
        "${env:windir}\\System32\\cmd.exe"
      ],
      "args": [],
      "icon": "terminal-cmd"
    },
    // "Git Bash": {  // "Git Bash" does not work
    "GitBash": {      // "GitBash" does work
      "path": "C:\\Program Files\\Git\\bin\\bash.exe",
      "icon": "terminal-bash"
    }
  },


  //  "terminal.integrated.defaultProfile.windows": "Git Bash"  // does not work for me
  "terminal.integrated.defaultProfile.windows": "GitBash"  // does work


  // deprecated but may still work for you
  // "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"

Previously trying to set Git Bash as default profile, for Git Bash it was suggested to use GitBash instead (remove the space). That never worked for me until today in the v1.60 Stable Build.

So might try changing your profile name to something other than Git Bash or WSL, etc, if that isn't working.

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

The solution that worked for me is:

Method 1:

Open Settings.json file and add the following line of code

"terminal.integrated.defaultProfile.windows": "Command Prompt"

After making this change my Settings.json file looks like this:

{
    "files.autoSave": "afterDelay",
    "window.zoomLevel": 1,
    "liveServer.settings.donotVerifyTags": true,
    "liveServer.settings.donotShowInfoMsg": true,
    "terminal.integrated.automationShell.windows": "",
    "terminal.integrated.automationShell.linux": "",
    "terminal.integrated.defaultProfile.windows": "Command Prompt"
}

Method 2:

Click on Settings and search for defaultprofilewindows

You will get the default terminal on this tab. Click on the menu list and select Command Prompt.

You can choose any of the available Terminals and check which one will work as you want.

Note: Using either method you will get the same results. Both of these above-mentioned methods are working perfectly for me.

ARHAM RUMI
  • 441
  • 5
  • 11
3

I have attempted to set the default terminal about a dozen times, but it is not sticking with the latest update. It keeps opening PowerShell as the default terminal. These settings have been working fine for me until yesterday's update (v1.60.0), which broke this.

    "terminal.integrated.defaultProfile.windows": "WSL",
    "terminal.integrated.profiles.windows": {
      "WSL": {
        "path": "C:\\WINDOWS\\System32\\wsl.exe",
        "args": [
          "~"
        ],
        "icon": "terminal-ubuntu"
      },
      "Git Bash": {
        "source": "Git Bash",
        "icon": "terminal-bash"
      },
      "Command Prompt": {
        "path": [
          "${env:windir}\\System32\\cmd.exe"
        ],
        "args": ["/K cls && cd /D C:\\OD"],
        "icon": "terminal-cmd"
      },
      "PowerShell": {
        "source": "PowerShell",
        "icon": "terminal-powershell"
      }
    }

Anyone else experiencing this?

kyL0r3nz0
  • 41
  • 3
2

I got it to load properly, but when I try to run a Python script using the run button, it runs in PowerShell.

"terminal.integrated.automationShell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"terminal.external.windowsExec": "C:\\Program Files\\Git\\bin\\bash.exe",
"terminal.integrated.profiles.windows": {


"PowerShell": null,
"Command Prompt": null,
  "Git Bash": {
    "path": "C:\\Program Files\\Git\\bin\\bash.exe",
    "icon": "terminal-bash"
  },
},
"terminal.integrated.defaultProfile.windows": "Git Bash"
bad_coder
  • 11,289
  • 20
  • 44
  • 72