VSCode is suddenly defaulting to powershell for integrated terminal and tasks - powershell

When I woke up this morning and launched VSCode my default terminal on launch, and when running tasks is now powershell, instead of Git Bash. I am on windows. I have tried changing the settings.json to no avail. Is there something I'm missing?
{
"workbench.startupEditor": "newUntitledFile",
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"[javascript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"aws.samcli.location": "C:\\Users\\king\\AppData\\Roaming\\npm\\sam.exe",
"typescript.updateImportsOnFileMove.enabled": "always",
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"explorer.confirmDragAndDrop": false,
"diffEditor.maxComputationTime": 0,
"extensions.ignoreRecommendations": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.renderControlCharacters": true,
"[jsonc]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"window.zoomLevel": 0,
"editor.accessibilitySupport": "off",
"workbench.editor.untitled.hint": "hidden",
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.external.windowsExec": "C:\\Program Files\\Git\\bin\\bash.exe",
"terminal.explorerKind": "external",
"terminal.integrated.automationShell.linux": ""
}
I found this related SO post making the default powershell, but I didn't see anything that was incorrect about my setting...especially because my goal is the opposite- to stop Powershell!

Update: Version v1.60.0 had a bug. Upgrade to v1.60.1 or higher for a fix.
The bug manifested in the following symptoms:
The Open in Integrated Terminal shortcut-menu command in the Explorer pane's shortcut always uses the built-in default shell (PowerShell on Windows), ignoring the configured one.
The same goes for running tasks (with or without a separate terminal.integrated.automationShell.* setting).
Also, if a given folder or workspace happened to have an integrated terminal open when quitting Visual Studio Code, the shell that is launched when the integrated terminal automatically reopens the next time is again the built-in default shell, not the configured one. By contrast, if reopening doesn't auto-open the integrated terminal, opening it manually does respect the configured default shell, and so does manually creating another shell instance later.
See GitHub issue #132150
The following information turned out to be unrelated to the bug, but is hopefully still useful general information about Visual Studio Code's recent change in how shells for the integrated terminal are configured:
Migrating from the legacy default shell settings to shell profiles:
Recently, the "terminal.integrated.shell.*" and "terminal.integrated.shellArgs.*" settings were deprecated and replaced with a more flexible model that allows defining multiple shells to select from, via so-called shell profiles, optionally defined in setting "terminal.integrated.profiles.*", with an associated mandatory "terminal.integrated.defaultProfile.*" setting referencing the name of the profile to use by default - which may be an explicitly defined custom profile or one of the built-in, platform-appropriate default profiles.
Note: * in the setting names above represents the appropriate platform identifier, namely windows, linux, or osx (macOS).
As of v1.60.1, if legacy "terminal.integrated.shell.*" settings are also present, the new settings take precedence (even though the tooltip when editing "terminal.integrated.shell.*" in settings.json suggests that this change is yet to come).
In the absence of both settings, Visual Studio Code's built-in default shell is used, which on Windows is PowerShell,[1] and on Unix-like platforms the user's default shell, as specified in the SHELL environment variable.
Recent Visual Studio Code versions, starting before v1.60 - seemingly as one-time opportunity - displayed a prompt offering to migrate the deprecated settings to the new ones.
Accepting the migration results in the following:
Creation of setting "terminal.integrated.shell.*" containing a custom shell profile derived from the values of legacy settings "terminal.integrated.shell.*" and, if present, "terminal.integrated.shellArgs.*"; that custom profile's name has the suffix (migrated)
Creation of setting terminal.integrated.defaultProfile.* whose value is the migrated profile's name, making it the default shell.
Removal of legacy settings "terminal.integrated.shell.*" and "terminal.integrated.shellArgs.*"
If you decline the migration, you can later effectively perform it by re-choosing the default shell, as described below.
Note: The new "terminal.integrated.defaultProfile.*" setting that is created in the process then effectively overrides the legacy "terminal.integrated.shell.*" and "terminal.integrated.shellArgs.*" settings, but the latter won't be removed automatically. To avoid confusion, it's best to remove them from settings.json manually.
Choose the default shell profile to use in order to (re)specify the default shell:
Click on the down-arrow part of the shell-selector icon () on the right side of the integrated terminal, select Select Default Profile, which presents a list of the defined profiles to select the default from - in the absence of explicitly defined profiles, standard profiles are offered (see below).
This translates into a terminal.integrated.defaultProfile.* setting in settings.json, whose value is the name of the chosen shell profile - which may be the name of a built-in profile or one of the ones explicitly defined in "terminal.integrated.profiles.*"
Note: This shell is by default also used for tasks (defined in tasks.json), but that can be overridden with a "terminal.integrated.automationShell.*" setting pointing to the executable of an alternative shell.
Optionally, in your settings.json file, you may create a platform-appropriate terminal.integrated.profiles.* setting with shell profiles of interest:
Note: Even if your settings.json contains no (platform-appropriate) "terminal.integrated.profiles.*" setting, Visual Studio code has built-in standard profiles it knows of and offers them for selection when choosing the default shell.
These standard profiles are a mix of shells that come with the host platform as well as some that Visual Studio detects dynamically on a given system, such as Git Bash on Windows.
To create the standard profiles explicitly, do the following:
Note: You may choose to do this in order to customize the standard profiles. However, if your intent is merely to add custom profiles - see this answer for an example - it isn't necessary to create the standard profiles inside the "terminal.integrated.profiles.*" setting, because Visual Studio Code knows about them even if not explicitly defined.
Via File > Preferences > Settings (Ctrl-,), search for profiles and click on Edit in settings.json below the platform-appropriate Terminal > Integrated > Profiles > * setting; this will open settings.json for editing, with the standard profiles added; simply saving the file is sufficient.
Note: If the "terminal.integrated.profiles.*" setting shown doesn't contain the expected, platform-appropriate standard profiles, a setting by that name may already be present; to force creation of the standard profiles, remove or comment out the existing setting and save the file, then try again.
On Windows, you'll end up with something like the following:
"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"
}
}
The answer you link to in your question, which provides an overview of the various types of shells used in Visual Studio Code, has been updated to reflect the information about the new shell profiles.
[1] Note: If a PowerShell (Core) v6+ installation is found, it takes precedence over the built-in Windows PowerShell version.

Edit:1
Note: Now this bug has been fixed by VSCode. Just update your VSCode to the latest version. (17-Sep-2021)
I have a temporary solution.
First paste this code in settings.json and save
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.profiles.windows": {
"C:\\Program Files\\Git\\bin\\bash.exe": {
"path": "",
"args": []
}
},
Before closing VSCode select Output instead of Terminal
Now you can open VSCode
After VSCode is loaded, you need to click on Terminal. After this you will now see bash.
Select output before whenever you close VSCode.
Reference: VSCode is suddenly defaulting to PowerShell for integrated terminal instead of $Bash in Windows
Note: This is not an solution. I shared this because maybe it can save you from getting disappointed.
This is my first post, if there is any mistake please let me know so that I can correct it.

You can always download and install previous releases from the official website https://code.visualstudio.com/updates/v1_59 (currently at the top).
As version 1.60 was bugged, v1.59 is a good candidate.
Disable automatic updates
Explained here.
Open User Settings File > Preferences > Settings.
Add "update.mode": "none" to your settings.
Install older version
Afterwards you can just overwrite current version with the installation of downloaded version.
Note: Wait for next version to fix it, so remember you had automatic update disabled!

I have same problem but I try run command prompt. I fix it by adding to ...\Code\User\settings.json
"terminal.integrated.automationShell.windows": "cmd.exe",

This could be related to issue 138999 which will add a mitigation/enhancement to VSCode 1.70 (July 2022) with PR 154290 and commit 91b82c0
increase barrier for available profiles to be ready
Wait up to 20 seconds for profiles to be ready so it's assured that we know the actual default terminal before launching the first terminal.
This isn't expected to ever take this long.
For VSCode with synchronized user settings, the profile might take more time than expected to fully load, hence the advantage of that workaround.

Simply replaced the CMD by Git Bash :-) in the settings.json
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
//"${env:windir}\\Sysnative\\cmd.exe",
//"${env:windir}\\System32\\cmd.exe"
"C:\\PrivateProgramms\\Git\\bin\\bash.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
//"path": [ "C:\\PrivateProgramms\\Git\\bin\\bash.exe" ],
//"args": [],
//"icon": "terminal-cmd"
}
},
"terminal.integrated.defaultProfile.windows": "Command Prompt"

Related

New way to specify Powershell 7 in Visual Studio Code?

I am trying to replace the default Powershell 5 with the newer Powershell 7, on Windows 11.
99% of the solutions on the internet say to add this to settings.json.
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"
However, this now gives a red squiggly line with the following message:
This is deprecated, the new recommended way to configure your default
shell is by creating a terminal profile in
#terminal.integrated.profiles.windows# and setting its profile name
as the default in #terminal.integrated.defaultProfile.windows#. This
will currently take priority over the new profiles settings but that
will change in the future.(2)
There is one possibly related thread, but it only deals with defaulting it to the native Command Prompt, rather than re-jigging things to Powershell 7.
So, what is the correct new way to provide Powershell 7s path to VS Code, and also set it as the default terminal?
In earlier VSCode (Visual Studio Code) versions, the "terminal.integrated.shell.*" and "terminal.integrated.shellArgs.*" settings determined the default shell and its startup arguments for the integrated terminal.
These have been superseded by shell profiles, defined via "terminal.integrated.profiles.*" properties, and an associated "terminal.integrated.defaultProfile.*" property that contains the name of the profile to use by default, as shown below (use > Preferences: Open Settings (JSON) from the command palette to open your settings.json file):
"terminal.integrated.profiles.windows": {
"PowerShell_7": {
"path": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"icon": "terminal-powershell"
}, // ...
}
// Make the profile defined above the default profile.
"terminal.integrated.defaultProfile.windows": "PowerShell_7"
Note:
The above defines the default general-purpose shell for Visual Studio Code's integrated terminal.
For information on how to specify what PowerShell version to use with the special-purpose PIC (PowerShell Integrated Console) that comes with the PowerShell extension (for authoring and debugging PowerShell code), see this answer.
I would have expected Visual Studio Code to use your v7 version automatically, as it - if installed - normally takes precedence over Windows PowerShell.

How to prevent VSCode to load powershell profile?

I have looked at VSCode settings, I can't see clearly what "integrated" means that's what I have but it loads external powershell profile. I want to prevent it to do so, is it possible ?
P.S. : I don't have and don't want powershell extensions, should I to have this option ?
Update: As suggested I have unchecked "powershell.enableProfileLoading" both in User and Workspace settings, relaunched vscode, but in terminal still gets "Loading personal and system profiles took" weirdly it still doesn't work for me ?
Is it possible this is a VSCode settings bug ?
If you DO have Visual Studio Code's PowerShell extension installed and you want to suppress loading of profiles in its special-purpose shell, the PowerShell Integrated Console (PIC):
GUI option: Via the Settings dialog, uncheck the option PowerShell: Enable Profile Loading
Settings.json file option: As Santiago Squarzon states, add the following setting:
"powershell.enableProfileLoading": false
If you do NOT have the PowerShell extension installed OR you (also) want to control profile loading for general-purpose PowerShell sessions running in Visual Studio's integrated terminal:
In the Settings dialog, search for terminal profiles and click on the Edit in settings.json link next to the platform-appropriate Terminal › Integrated › Profiles: <os> entry, where <os> is one of windows, linux or osx (macOS).
This will open your Settings.json file for editing and either create or navigate to a preexisting "terminal.integrated.profiles.<os>"object, which contains the profiles of all shells available in the integrated terminal.
Locate the PowerShell profile and add an "args": [ "-noprofile" ] property in order to suppress profile loading, which passes the -noprofile parameter to the PowerShell CLI (powershell.exe for Windows PowerShell, pwsh for PowerShell (Core) 7+) on startup; e.g., on Windows:
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": [ "-noprofile" ]
},
// ...
}

Git-Bash in Visual Studio Code from the D drive

I am trying to use Git Bash as a terminal in Visual Studio Code, however I am not able to find it in the terminal profiles. The option for Git Bash doesn't appear in the available terminals. I have installed Bash already. However I did it in the D drive. Is there a way to make git-bash available to choose as a terminal or even make it the default one from the D drive?
You can create your own profile in the setting.json file and set the default terminal profile to it, like so (for Windows):
"terminal.integrated.profiles.windows": {
"My Git Bash":{
"path": "D:\\GitbashLocation\\git-bash.exe",
"icon": "terminal-bash"
}
},
"terminal.integrated.defaultProfile.windows": "My Git Bash",
Note that you can name your profile whatever you want. You may also need to restart Visual Studio Code after defining your profile so it detects it when you specify it in the terminal.integrated.defaultProfile.windows setting.
I was also struggling with the same but finally got it fixed with thanks to the final bit of help needed from #Timothy G's answer, with the help of other posts here on stack as well.
Let me just post a step-by-step solution adding to the #Timothy G's answer below, JIC if you're still struggling with it and also for future visitors.
Note: I'm using VS Code Insiders build (Version: 1.64.0-insider(user setup)) on Windows, but should work for other builds as well.
Since you have already downloaded git bash, ignore the 1st step.
Download git bash from the https://git-scm.com/download/win.
Open VS Code ⟹ File ⟹ Preferences ⟹ Settings. (Ctrl + ,).
There will be a search bar on top.
Search for terminal.integrated.profiles.windows.
A result will come up that would look like this
Terminal › Integrated › Profiles: Windows
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.
Edit in settings.json
Click on Edit in settings.json.
Then another window will pop up next to the Settings tab called settings.json
Copy and paste this inside the settings.json. Remember to set the “path” to your git bash.exe in the bin folder
You can remove the first two lines if you don't need it and do Ctrl + S to save the JSON settings.
{
"workbench.colorTheme": "Default Dark+",
"files.autoSave": "afterDelay",
"terminal.integrated.profiles.windows": {
"My Git Bash":{
"path": "I:\\Projects\\git\\bin\\bash.exe",
"icon": "terminal-bash"
}
},
"terminal.integrated.defaultProfile.windows": "My Git Bash",
}
After adding the above, select the “Settings” tab again and search for terminal.integrated.defaultProfile.windows
Then you'll be presented with a terminal feature like this with a drop-down.
Terminal › Integrated › Default Profile: Windows
The default profile used on Windows. This setting will currently be ignored if either terminal.integrated.shell.windows or terminal.integrated.shellArgs.windows are set.
Under the drop-down, select the profile My Git Bash then you're
all set.
Then got to ⟹ View ⟹ Terminal. (Ctrl + `)
It should now show up with the bash terminal. If it doesn't, restart VSC and it'll work for sure.
In order to make Timothy G.'s answer work, first, add the new profile as described in the VSCode documentation:
Step 1: "To create a new profile, run the Terminal: Select Default Profile command and activate the configure button on the right side of the shell to base it on. This will add a new entry to your settings that can be tweaked manually in your settings.json file."
https://code.visualstudio.com/docs/editor/integrated-terminal#_terminal-profiles
Type in a new name in the input box after you click the "configure" button. This will create a new profile in settings.json with your new name cloned from an existing profile (against which you clicked the "configure" button).
Step 2: Go to the settings.json file. You will see the profile with your new name added there. Update it with Timothy G's settings. Here is how mine looks like:
{
"My Git Bash": {
"path": "D:\\Git\\bin\\bash.exe",
"icon": "terminal-bash"
}
"terminal.integrated.defaultProfile.windows": "My Git Bash"
}
Step 3: Save and restart VSCode. The next time the terminal will open with Git Bash.

Use cmder as default shell in VSCode

Every other solution I can find to this question says to put the settings below inside my.vscode/settings.json
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/K",
"C:\\softwares\\cmder\\vendor\\init.bat"
],
This worked until recently, when I removed my settings file from a git repo. Now when I hover over the code above, I get this text in a popup
The path of the shell that the terminal uses on Windows (default:
C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe). Read more
about configuring the shell. This is deprecated, use
#terminal.integrated.defaultProfile.windows# instead(2)
This is a bit confusing to me, I'm not sure what I have to change to what. I tried changing the first setting to
"terminal.integrated.defaultProfile.windows": "C:\\WINDOWS\\System32\\cmd.exe",
But this has had no effect. Cmder is not being used as the default shell.
VSCode changed how integrated terminal profiles are handled in April 2021. Based on the args you provided in your question, adding this to your settings.json should work:
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [
"/K",
"C:\\softwares\\cmder\\vendor\\init.bat"
],
"icon": "terminal-cmd"
}
},
"terminal.integrated.defaultProfile.windows": "Command Prompt"
cmder comes as an executable program. You do not need to use a batch script to open it. Just firing the exe starts the program.
(from the official download page:)
Unzip
(optional) Place your own executable files into the bin folder to be injected into
your PATH.
Run Cmder (Cmder.exe)
Therefore, you just need to add a single line to settings.json:
"terminal.integrated.shell.windows": "C:\\full\\path\\to\\unzipped\\cmder.exe"
This shouldn't need to take in any flags or commands, args, unless you are wanting to change it's default functionalities (such as changing the default folder that the cursor points to on launch). For default cmder, just run the exe...
try add follow config in settings.json
"terminal.integrated.automationShell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
A path that when set will override terminal.integrated.shell.windows and ignore shellArgs values for automation-related terminal usage like tasks and debug.

How to add multiple terminals in VS Code?

Can we add multiple different terminals in the VS Code? I am planning to add following three terminal and work with all of those :
Windows Command prompt
PowerShell
Git Bash
I know I need to add the following command in Preferences => Setting
// // 64-bit cmd if available, otherwise 32-bit
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\cmd.exe",
// // 64-bit PowerShell if available, otherwise 32-bit
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",
// // Git Bash
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
I want to add all of the above three commands in setting.json
And when I click + different terminal should open and I want to work with those terminals without changing the preferences.
Is it possible in VS Code or not?
There is a way to make this happens with these steps by installing an extension:
Find an extension called Shell launcher and install it or you can find it here. Reload VS Code if you want or after you finished all steps.
Go to Files --> Preferences --> Settings and this will open settings.json file and you then insert this (you can edit this to your heart's content):
Code:
"shellLauncher.shells.windows": [
{
"shell": "C:\\Windows\\<sysnative>\\cmd.exe",
"label": "cmd"
},
{
"shell": "C:\\Windows\\<sysnative>\\WindowsPowerShell\\v1.0\\powershell.exe",
"label": "PowerShell"
},
{
"shell": "C:\\Program Files\\Git\\bin\\bash.exe",
"label": "Git bash"
},
{
"shell": "C:\\Windows\\<sysnative>\\bash.exe",
"label": "WSL Bash"
}
]
PS: You can use shellLauncher.shells.linux for Linux or shellLauncher.shells.osx for macOS.
Go to Files --> Preferences --> Keyboard Shortcuts and then find on {} icon on the top right corner to open keybindings.json file. Insert this:
Code:
[
{ "key": "ctrl+alt+`", "command": "shellLauncher.launch" }
]
Update: Type shelllauncher into the search bar. You can then see Shell Launcher: Launch command. Highlight and use any keybinding you like. For example, I picked Ctrl + Alt + (backtick)` for myself.
You can reload your VS Code and click the key combination you have assigned and that will give you the option to choose which integrated terminal you want to use.
For more details, please check the official site: https://marketplace.visualstudio.com/items?itemName=Tyriar.shell-launcher
Enjoy!
Even the question is asked last year and the answer is accepted but still I feel to answer this question as I didn't found any simple, suitable and complete answer while as a development I need multiple terminal handy in a click like below:-
and I don't bother about their path, add another extension for what the VS Code is already capable of or reload VS Shell etc and go to insert and setup the settings files manually.
I found this question is asked many times and almost all landed up manually setup of write some settings etc. or sometimes only opted to get a single type of terminal. The answer of #Pawan is somewhat near but again that solution finally land up to a single terminal, going to command setup for switch terminal and this one will work for git or any other terminal.
If you have tools installed which worked on command line like power-shell and git along with default cmd prompt in windows then the follow the quick three steps to get all terminals at once and switch to anyone with a click.
Open terminal, it should be visible (use ctrl+` or from menu View-> Integrated Terminal )
Open commands search (use Ctrl+Shift+P or from menu View->Command Palette...)
In command box Type "Terminal: Select Default Shell" to select this option from drop down.
As you select this option, then all the available commands which are in path will be listed below like below
Just click any one which you like to add for quick access from command list.
Finally, in the terminal window, just click on + sign next to terminal list as shown below:-
The terminal selected in step 5 will now added after performing step6 to the list without removal of earlier terminal.
Repeat step 3-6 for adding any other terminal to command list.
To work with particular terminal just select the required one in the terminal list of the terminal window.
press ctrl + shift + ` shortcut, or press a cross sign to run new terminal, then type bash if your default mode is powershell or powershell if your default mode is bash. And here you are, your terminal is switched.
For now VS Code support defining only one of available terminals as default at a time and you can not add multiple shell terminals.
If you don't want to install "Shell Launcher" plugin as suggested by #ian0411 then here is a quick way to change/select default terminal.
Press "Ctrl + Shift + P" to open the Command Palette.
Type "Terminal: Select Default Shell" and hit enter. You will be prompted to select Git Bash, PowerShell or Cmd as shown below:
Note: This will change the default shell terminal but there is no harm changing it whenever you need to use another.
BTW, if you need to switch only between Cmd & Powershell then you can type cmd or powershell (in already opened terminal) to switch to desired terminal. But it would not work for Git Bash.
I don't see this in the above, but read all the answers. I think this is the best approach for what is supported right now. I believe, like myself, the OP simply wants to open VSCode, and down yonder on the terminal window, we just want a list of options to open from.
Yes, you can open the command, "Terminal: Select Default Shell" and loop through that to add various types of terminals...
Followed by:
I don't know when this option was added to the dropdown, but look! No need to start by looking up the command. I think this is a lot smoother than any other answer, but it still results in the annoying overwrite of your default term to whatever your last choice was before leaving session.
Here, we can more easily open the Select Default Shell - it should support "Select New Shell". Simple, you'd think. Hopefully someone adds that soon or I have time to contribute.
I'm fairly certain that these are old-style settings.json and won't work as discussed in VS Code 2021. The new style looks like:
...
"terminal.integrated.profiles.windows":
{ "Bash":
{ "path": ["C:\\Programs\\Git\\bin\\bash.exe"],
"icon": "terminal-bash",
},
"Command Prompt":
{ "path": ["${env:windir}\\System32\\cmd.exe"],
"args": [],
"icon": "terminal-cmd"
},
"PowerShell":
{ "path": ["C:\\Programs\\PowerShell\\pwsh.exe"],
"source": "PowerShell",
"args": [],
"icon": "terminal-powershell"
},
},
"terminal.integrated.defaultProfile.windows": "Bash"
...
That will get you access to Command and PowerShells and set bash as the default shell (my preference). If you want to launch a standalone application like git-bash, you will need something else.
As of https://code.visualstudio.com/updates/v1_35 you can now:
select from the pulldown menu directly above the terminal "Select Default Shell"
select the one you like
click the +
done
(the same goes for opening split screen: before this do 1 + 2 and then click the split screen button)
(although overriding the default but does no longer matter if this is your flow)
This can be done by adding a different key at the end. By just changing your example to:
// // 64-bit cmd if available, otherwise 32-bit
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\cmd.exe",
// // 64-bit PowerShell if available, otherwise 32-bit
"terminal.integrated.shell.windows2": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",
// // Git Bash
"terminal.integrated.shell.windows3": "C:\\Program Files\\Git\\bin\\bash.exe",
Note that the key ...shell.windows is changed to ...shell.windows2 and ...shell.windows3.
Follow-up finding: I've noticed that once restart of the IDE, only the first terminal gets displayed. I had to reopen the settings and save it once to get both the terminals again. Will post if any better solution available.
In the terminal tab, there's a Split Terminal button. Works like a charm
To open the multiple terminal please check the screen shot for the same(on the right bottom of the visual studio code their will be a dropdown and just after it, their is +(plus) icon . On pressing it the new terminal will open.).
The recommended way to automatically open multiple terminal windows is to use the Tasks feature. See Automating launching of terminals in the VS Code documentation.
For WSL Ubuntu on Windows terminal:
File -> preferences -> settings -> click code icon in top right
Enter the following:
{
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe",
"git.enableSmartCommit": true
}