I want to debug a code that has std::cin on it.
If I put on launch.json '"externalConsole": false', I can't write anything (because there's no console to work on it).
However, If I put "externalConsole": true, my args of the shell are just ignored.
I'm using just IntelliSense.
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe - Criar e depurar o arquivo ativo",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Habilitar a reformatação automática para gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe arquivo de build ativo"
}
]
}
settings.json:
{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"terminal.external.windowsExec": "C:\\Windows\\System32\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k",
"chcp 65001"
],
"workbench.colorTheme": "Visual Studio Dark - C++",
}
I need to use '"terminal.integrated.shellArgs.windows": ["/k", "chcp 65001"]' to use my encoding system.
Is there a way to work around this problem?