Reputation: 21
I'm trying to do debugging c/c++ program in vscode debug tab. Well, after setting some properties which is spread through google, it works well. However, when I try to do debug with program containing "scanf" or "cin" which requires user input, it never receives any input from my keyboard. How can I do so?
And what I found from google is that setting "externalConsole" value as true like this picture.
{
"version": "0.2.0",
"configurations": [
{
"name": "g++ - 활성 파일 빌드 및 디버그",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/Sort/test",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb",
"preLaunchTask": "C/C++: g++ build active file"
}
]
}
However, if I change the value of externalConsole as true and try to debug program containing cin, there is no progress after the below picture.
Even though I try to input the data in the external console(for example "asd"), it says "zsh:command not found asd". How can I fix it for program to receive my input. HELP ME PLZ
Upvotes: 0
Views: 1322
Reputation: 17
Code -> Preferences -> Settings
Follow these steps and you will be able to run your code on VSCode terminal and it would be possible to enter Input
Upvotes: 2