我正在尝试使用visual studio代码调试简单的hello世界。如何在我的调试器设置文件中设置终端路径?我正在使用以下设置。
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"launchOptionType": "Local",
"miDebuggerPath": "/usr/bin/gdb",
"targetArchitecture": "x64",
"program": "${workspaceRoot}/hello.out",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true
},
{
"name": "C++ Attach (GDB)",
"type": "cppdbg",
"request": "launch",
"launchOptionType": "Local",
"miDebuggerPath": "/usr/bin/gdb",
"targetArchitecture": "x64",
"program": "${workspaceRoot}/hello.out",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceRoot}",
"environment": [],
"processId": "enter program's process ID",
"externalConsole": true
}
]
}
答案 0 :(得分:1)
修复很简单,打开终端并输入以下命令:
cd /usr/bin
sudo ln -s ./{your_terminal} xterm
答案 1 :(得分:0)
创建这个/ usr / bin / xterm脚本:
#!/bin/bash
/usr/bin/konsole -e 'bash -c "$6"'
在VSCode中正常工作。由于引用,符号链接无法正常工作。