linux vscode终端输出,vs code中如何强制捕获输出到调试控制台?

vs code调试c++的输出结果会在一个新的终端中输出,而不是被vs code捕获。

bVCCoE

bVCCot

请问更改什么设置可以让vs code捕获输出结果到调试控制台?

查阅了官方文档,但是并没有提及。

环境

ubuntu 14.04-64

gcc-4.8.4

gdb-7.7.1

以下为launch.json和tasks.json。

launch.json

{

"version": "0.2.0",

"configurations": [

{

"name": "C++ Launch",

"type": "cppdbg",

"request": "launch",

"program": "${workspaceRoot}/a.out",

"args": [],

"stopAtEntry": true,

"cwd": "${workspaceRoot}",

"environment": [],

"preLaunchTask": "g++",

"externalConsole": true,

"linux": {

"MIMode": "gdb"

},

"osx": {

"MIMode": "lldb"

},

"windows": {

"MIMode": "gdb"

}

},

{

"name": "C++ Attach",

"type": "cppdbg",

"request": "attach",

"program": "${workspaceRoot}/a.out",

"processId": "${command.pickProcess}",

"preLaunchTask": "g++",

"linux": {

"MIMode": "gdb"

},

"osx": {

"MIMode": "lldb"

},

"windows": {

"MIMode": "gdb"

}

}

]

}

tasks.json

{

// See https://go.microsoft.com/fwlink/?LinkId=733558

// for the documentation about the tasks.json format

"version": "0.1.0",

"command": "g++",

"isShellCommand": true,

"showOutput": "always",

"args": ["-g", "main.cpp"],

"problemMatcher": {

"owner": "cpp",

"fileLocation": ["relative", "${workspaceRoot}"],

"pattern": {

"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",

"file": 1,

"line": 2,

"column": 3,

"severity": 4,

"message": 5

}

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值