In vs code terminal only cmd shows up in the drop down

Viewed 74

In vs code terminal only cmd shows up in the drop down. I used to have PowerShell, Git Bash, etc. Any idea what happened and how I can fix it?

enter image description here

My VS Code version information is:

Version: 1.27.1 (user setup)
Commit: 5944e81f3c46a3938a82c701f96d7a59b074cfdc

    Date: 2018-09-06T09:21:18.328Z
    Electron: 2.0.7
    Chrome: 61.0.3163.100
    Node.js: 8.9.3
    V8: 6.1.534.41
    Architecture: x64

I noticed that my C:\Users\YourLegalId\AppData\Roaming\Code\User\settings.json file looked like:

{
"editor.largeFileOptimizations": false,
"editor.renderControlCharacters": true,
"terminal.integrated.shell.windows": "C:\\windows\\System32\\cmd.exe"
}

I asked coworker what theirs looked like and he said his was empty. I tried emptying min out and then I only see PowerShell!

2 Answers

You can tweak the drop down menu by adding these lines to your settings.json and modify them as you see fit:

  // The Windows profiles to present when creating a new terminal via the terminal dropdown.
  // Use the `source` property to automatically detect the shell's location.
  // Or set the `path` property manually with an optional `args`.
  // 
  // Set an existing profile to `null` to hide the profile from the list,
  //for example: `"Ubuntu-20.04 (WSL)": null`.

  "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": {
      "source": "Git Bash"
    }
  },

Then, you can choose your default shell by adding this line:

"terminal.integrated.defaultProfile.windows": "PowerShell",

The version that I had 1.27.1 was quite old, even though Help > Check for Updates showed no updates available. I downloaded a new VS code from Microsoft's website and ran it. I was upgraded to version 1.63.2 and it fixed my command prompt issues.

Related