Whenever I create new project in VS Code using Developer Command Prompt, workspace explorer kind (terminal) is being set to integrated, even though it's external in overall user settings.
Worspace settings
User settings
settings.json
First of all, it's already weird that it's being set to integrated even though it's external in user settings and it should have followed what's in user settings in the first place when you create a brand new project unless I change it myself after creating the project.
However it doesn't end here. Even if I manually change the setting in workspace to external and build program using MSVC compiler (cl.exe) it is still being opened in integrated terminal like nothing changed. Even if I create "setting.json" inside my project and manually type "terminal.explorerKind": "external"
it doesn't work.
Program runs in the integrated terminal despite the setting being changed to external
The only way around is by adding debug configuration and there changing console to "externalTerminal"
in launch.json.
So it seems like the problem lies in cl.exe, MSVC or Developer Command Prompt that sets default value to integrated terminal.
I don't mind integrated terminal and even want it more than external one, but the behaviour seems very strange to me.
I was tweaking this setting in the past and now tried to get back to external terminal and it turned out unsuccesful as you see with only possible solution being to overwrite the launch.json
inside the project, which bothers me a lot.
I suspect I have to change default launch configuration of cl.exe, but how to do that?
Even if I create "setting.json" inside my project and manually type "terminal.explorerKind": "external" it doesn't work.
The only way around is by adding debug configuration and there changing console to "externalTerminal" in launch.json.
That's not a "way around". That's the correct way to do to get what you want for launching a C or C++ program using the cppvsdebug launch config type.
"terminal.explorerKind": "external"
doesn't apply to cppvsdebug-type launch configs. That's just not what it does. Read its description (emphasis added):
When opening a file from the Explorer in a terminal, determines what kind of terminal will be launched
external
: Use the configured external terminal.
I'm not aware of a way to change defaults for extension contributed launch configuration types. You can, however, define launch configurations globally, and use their group > isDefault
property with a glob pattern to define it as a global default for files of that extension (see this post for an example of the default glob thing).