visual-studio-code - 内部调试控制台不接受我的输入
问题描述
当我在内部调试控制台(例如数字)中输入我的输入时,我收到消息“无法执行此操作,因为进程正在运行”。(输出没有问题),但是当我在launch.json中切换外部控制台(Windows控制台)时,我没有遇到任何问题。
我已经阅读了一些关于 VSC 中调试的纪录片(例如 code.visualstudio.com/Docs/editor/debugging),但没有任何内容。我不应该在那里输入输入吗?另外,我的输出只显示在调试控制台中,这也正常吗?我也无法通过终端输入我的输入。即使我开始没有调试情况也不会改变。如果我使用扩展名“C/C++ Compile Run”,则会创建正常的内部终端,我可以与之交互。
我的 launch.json 配置
"name": "g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"internalConsoleOptions": "openOnSessionStart",
"externalConsole": false,
"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"
我的任务.json:
"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"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
c_cpp_properties.json:
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.17763.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
解决方案
推荐阅读
- eclipse - 如何配置 Eclipse 自动静态导入以更喜欢 MatcherAssert.assertThat 而不是 Assert.assertThat?
- flutter - 我可以在一个应用程序中使用 2 个 MaterialApp 小部件吗?
- sql - SQL - 对除上述之外的所有行求和
- java - 由于环境的变化,java new date() 函数以 'DD-MON-YYYY HH:MM:SS' 格式给出日期。但预计只有“DD-MON-YYYY”格式
- python-3.x - name, *line = input().split() 在这里我可以使用 *line 作为列表吗?
- sqlalchemy - 如何在 sqlalchemy 中为父子集批量加载关系?
- c++ - strip - Qt 创建者在发布时无法识别文件格式,但在调试时无法识别
- python - 如何从上下文托管资源内部启动独立的上下文托管资源
- laravel - 如果有数据,请检查表单字段
- macos - 使用量角器运行脚本时获取“驱动程序信息:driver.version:未知”