如何使用 vscode 中包含的 xvfb-run 进行调试?

问题描述 投票:0回答:1

我想用

rl_methods.py
来调试
xvfb-run
,就像输入命令一样

xvfb-run -a -s "-screen 0 640x480x24" python rl_methods.py

在终端中。 我应该如何修改

launch.json
才能实现这一目标。

vscode-debugger xvfb
1个回答
0
投票

我询问了chatgpt并测试了它的答案。这是启动配置:

"configurations": [
{
    "name": "Python: xvfb-run rl_methods.py",
    "type": "python",
    "request": "launch",
    "program": "${workspaceFolder}/rl_methods.py",
    "args": [],
    "env": {},
    "console": "integratedTerminal",
    "preLaunchTask": "Run xvfb-run"
}
]

这是相应的任务配置:

"tasks": [
{
    "label": "Run xvfb-run",
    "type": "shell",
    "command": "xvfb-run -a -s \"-screen 0 640x480x24\"",
    "args": ["python", "${workspaceFolder}/rl_methods.py"],
    "problemMatcher": [],
    "isBackground": true
}
]
© www.soinside.com 2019 - 2024. All rights reserved.