由于我无法在调试控制台中提供输入,因此我尝试在 VS Code 的外部终端中运行调试器。
这是外部终端的 launch.json 配置文件的一部分。
{
"name": "Python: Terminal (external)",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${file}",
"cwd": "",
"console": "externalTerminal",
"env": {},
"externalConsole": true,
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
},
我按照他们所说的添加了 "externalConsole": true
部分 here我尝试了有或没有该声明。
我得到这个错误,
Debug adapter process has terminated unexpectedly
我尝试了 docs和 json 文件中的 IntelliSense,但我无法理解并让它工作。
最佳答案
将 "console": "externalTerminal",
添加到调试配置文件在 Linux 上运行良好!
关于python - VS 代码中的外部终端调试器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47687411/