Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS code - Hide build/echo task for cpp

I'm using VS Code for running c++ code.

Whenever I Ctrl + Shift + B to build my .cpp file, an 'echo' tab pops up, which makes the entire bottom panel appear and then I am asked to "Terminal will be reused by tasks, press any key to close it."

I don't want the tab or the panel to pop up at all and want the entire build process to happen in silence, nothing pops up.

This is my tasks.json file

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
    {
        "label": "echo",
        "type": "shell",
        "command": "gcc",
        "args":[
            "main.cpp","-lstdc++","-o" ,"main.exe"
        ],
        "group": {
            "kind": "build",
            "isDefault": true
        }
    }
]

}

like image 786
Nguyen Khac Khanh Lam Avatar asked Sep 02 '26 08:09

Nguyen Khac Khanh Lam


2 Answers

This can be configured using "presentation": {...}. Following worked for me:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Test task",
            "type": "shell",
            "command": "echo Hello world",
            "presentation": {
                "echo": true,
                "reveal": "never",
                "showReuseMessage": false,
            }
        }
    ]
}
like image 144
HolyBlackCat Avatar answered Sep 03 '26 20:09

HolyBlackCat


Solved by downgrading VSCode to 1.60: https://code.visualstudio.com/updates/v1_60

like image 28
Nguyen Khac Khanh Lam Avatar answered Sep 03 '26 21:09

Nguyen Khac Khanh Lam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!