Type: Debugger
When I use the default "g++.exe build and debug active file" and there's no output in internal terminal. However, when using external terminal it works. Have no idea.
Here's my launch.json and tasks.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Terminal (external)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "externalTerminal"
},
{
"name": "g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++.exe build active file"
}
]
}
{
"tasks": [
{
"type": "shell",
"label": "g++.exe build active file",
"command": "C:\\MinGW\\bin\\g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "C:\\MinGW\\bin"
}
},
{
"type": "shell",
"label": "gcc.exe build active file",
"command": "C:\\MinGW\\bin\\gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "C:\\MinGW\\bin"
}
}
],
"version": "2.0.0"
}
BTW: Another bug confused me a lot, however after I reinstall the VSCode it disappeared, but if you can help me out I'd like to appreciate it. The link is here: https://github.com/Microsoft/vscode/issues/70542
Describe the bug
I seem to recall hearing that debugger input/output doesn't work with the internal terminal? @WardenGnaw Is there another issue tracking that?
@paulzhn The VS Code bug you reported may have been fixed with our 0.22.1 release.
@paulzhn with the default g++.exe build and debug active file, does the external console come up? From what I understand (and @bobbrow can correct me if i'm wrong) that "command" uses a built in launch.json and doesn't allow additional configuration.
Based on your files that you linked, it should be working when you change externalConsole to false to use the integrated terminal. Does it work with regular debugging?
@pieandcakes @WardenGnaw What milestone should this be moved to?
@pieandcakes Sorry for the delay... The problem still exists, which means when I change externalConsole to false it cannot work. However when changed to true, it works in external console.

When using intergrated terminal, it looks like this, and nothing happened then.
When using "externalConsole": false the output goes to the "Debug Console" window, not the "Terminal"
To answer @pieandcakes question from a while ago (sorry, I didn't see it earlier), the build and debug active file feature generates a launch.json that you can edit.
@paulzhn it should go to the Terminal as that was how it was working before but i think with a recent change by VS Code it is broken. As of now, you can see it in the debugConsole
I have the same error in wsl
Hey @pieandcakes, this issue might need further attention.
@paulzhn, you can help us out by closing this issue if the problem no longer exists, or adding more information.
This issue has been closed automatically because it needs more information and has not had recent activity.