Few days ago I assume Microsoft released a new update for VSCode and when I came to build my esp idf project it didn't work because it relies on a command to run from the terminal before it's "special" project build command is executed and I came to the conclusion that the following setting that allowed that automatically was in file main.code.workspace in "settings" were:
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k",
"C:/Coding/ESP32/esp-idf/export.bat"
],
and the error is as follows:
This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in
#terminal.integrated.profiles.osx#
and setting its profile name as the default in#terminal.integrated.defaultProfile.osx#
. This will currently take priority over the new profiles settings but that will change in the future.
What is the new way to configure the default terminal at startup and run this command?
In the settings.json file we need to have 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"
}
},
And set the default terminal by adding
"terminal.integrated.defaultProfile.windows": "Command Prompt",
We can achieve this by pressing Ctrl + Shift + P and searching for Terminal: Select Default Profile and selecting the required shell.
However, although deprecated the setting you have currently should work for now.
I have solved this by
1)Add Git/bin to the path in env variables
2)Restart VSC and add the following in 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"
],
"icon": "terminal-cmd"
},
"GitBash": {
"path": ["F:\\Program files\\Git\\bin\\bash.exe"],
"icon": "terminal-bash"
},
},
"terminal.integrated.defaultProfile.windows": "GitBash",
just replace 'your path of git bash' in path for "GitBash"
3)Remove old settings
for me it was
"terminal.integrated.shell.windows": "F:\\Program files\\Git\\bin\\bash.exe"
4)Save settings, Close terminal of VSC by pressing delete, restart VSC
Hope this works!
I recently upgraded to VSCode 1.60 on windows and having similar problem I added the above mentioned "GitBash" option to profiles but when I tried to use it like this:
"terminal.integrated.defaultProfile.windows": "GitBash",
VSCode complained that "GitBash" is not a valid value:
Value is not accepted. Valid values: "PowerShell", "Command Prompt", "JavaScript Debug Terminal".
So instead I updated the "Command Prompt" profile to point to my git bash and this WORKED
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"C:\\<PATH TO MY bash.exe>",
],
"args": [],
"icon": "terminal-bash"
}
},
"terminal.integrated.defaultProfile.windows": "Command Prompt",
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With