Reputation: 31
I am learning C++ using vscode on mac BigSur. Terminal always prints "Terminal will be reused by tasks, press any key to close it." And after trying adding on 'presentation' with property 'panel:new'. This issue still happens.
this is my task.json
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "new"
},
"detail": "Generated task by Debugger"
}
],
"version": "2.0.0"}
this is my launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "g++ - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"preLaunchTask": "C/C++: g++ build active file"
}
]}
Upvotes: 2
Views: 4191
Reputation: 11
I encountered this issue, and with God's help, I did the following to solve the problem:
After that Install old version of the C++ extension. And run the code; This process works for some time and then the task returns again.
or
or
install C/C++ Compile Run
This method worked for me
Upvotes: 1
Reputation: 146
The message "Terminal will be reused by tasks, press any key to close it."
can be avoided by adding the property "showReuseMessage": false
inside the "presentation" block.
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "new",
"showReuseMessage": false
},
However, we still need to press the enter key to get back to command prompt. To avoid pressing the enter key, another property "close": true
should also be added inside the "presentation" block.
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "new",
"showReuseMessage": false,
"close": true
},
I have tested above in Visual Studio Code version 1.68.0 in Windows 10, 64 bit platform.
Upvotes: 2