Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run same instance of terminal with build task in VS Code

I have a build.bat file for which I would like VS Code to run when I try and build my project. To do this in VS Code you setup a task.json file and I've done so:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "type": "shell",
            "windows": {
                "command": "${workspaceRoot}\\build.bat"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

The problem I'm having is each time I run the task it seems to generate a new terminal instance. Is there a way to have VS Code keep re-using the same terminal instance for its build tasks?

like image 588
Jason Avatar asked Nov 08 '22 11:11

Jason


1 Answers

You can use the :

  terminal.integrated.automationShell

Setting to set the shell that will be used for all automation in VS Code, which includes Tasks

like image 59
ShifaT Avatar answered Nov 18 '22 08:11

ShifaT