C:\Users\Administrator\AppData\Roaming\Code\User\settings.json
{
// "terminal.integrated.automationShell.windows": "/K chcp 65001 >nul",
// "terminal.integrated.fontFamily": "Lucida Console",
// "code-runner.runInTerminal": true,
"workbench.colorTheme": "Monokai",
"workbench.preferredDarkColorTheme": "Monokai",
// "terminal.external.windowsExec": "C:\\WINDOWS\\System32\\abc.exe",
// "terminal.integrated.shell.windows": "D:\\Program Files\\Git\\bin\\bash.exe",
// "terminal.integrated.env.windows": {
// "CHERE_INVOKING":"1"
// },
// "terminal.integrated.shellArgs.windows": [ "--login" ],
}
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": "(mingw gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "D:/tools/mingw64/bin/gdb.exe",
// "miDebuggerPath": "D:/Program Files/Git/usr/bin/gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "make",
},
]
}
task:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "make",
"type": "shell",
"command": "make",
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "clean",
"command": "make",
"args": [
"clean"
],
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "compile",
"command": "gcc",
"args": [
"-Wall",
"-I./include",
"${fileBasename}",
"-o",
"main"
],
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}