microsoft / microsoft/vscode-cpptools
User input when debugging C++ on MacOs
@WardenGnaw arbeitet bereits daran.
Seit 03.6.2020.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
Type: Debugger
Describe the bug
-
OS and Version:

-
VS Code Version:

-
C/C++ Extension Version: 0.28.1
-
Other extensions you installed (and if the issue persists after disabling them):

-
A clear and concise description of what the bug is.
When attempting to debug a simple C++ script that requires user input, the external console does not allow for the input to be given, instead displaying darwin-debug description (print screen in additional context.).
To Reproduce
Please include a code sample and launch.json configuration.
Code sample
#include <iostream>
using namespace std;
int main(){
string output;
cout << "Teste" << endl;
cin >> output;
cout << output << endl;
return 0;
}
launch.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": "clang++ - Criar e depurar o arquivo ativo",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb",
"preLaunchTask": "clang++ build active file"
}
]
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-std=c++17",
"-stdlib=libc++",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Steps to reproduce the behavior:
- Create .vscode folder and within it setup tasks.json and launch.json.
- Create hello_world.cpp and paste the code sample.
- Select the run and debug tab.
- Click the green run icon.
Additional context
External console print screen

I have already tried using the workaround described at #https://github.com/microsoft/vscode-cpptools/issues/5079#issuecomment-626090192
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.