编程语言
首页 > 编程语言> > VSCODE运行C程序的时候如何同时打开两个终端

VSCODE运行C程序的时候如何同时打开两个终端

作者:互联网

      编写UDP客户端和服务端的时候,需要同时运行两个终端来模拟通讯。我使用的IDE是VSCODE,由于一开始配置C++环境的时候, launch.json中只配置了一个shell,所以只能同时打开一个 。我们只要上面两个配置文件中将配置再拷贝一份即可。如下所示。

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": "C/C++_one",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/${fileBasenameNoExtension}.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "preLaunchTask": "build",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        },
        {
            "name": "C/C++_two",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/${fileBasenameNoExtension}.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "preLaunchTask": "build",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

标签:launch,VSCODE,程序,gdb,printing,终端,pretty,workspaceFolder,true
来源: https://blog.csdn.net/qq_37437983/article/details/113358143