Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch vscode task in external terminal via tasks 2.0.0

Is it possible to launch bat file via external terminal, not inside a vscode terminal?

Task sample:

{
    "label": "Build",
    "type": "shell",
    "command": "./build.bat",
    "presentation": {
        "reveal": "always",
        "panel": "new"
    },
    "problemMatcher": [],
    "group": {
        "kind": "build",
        "isDefault": true
    }
}
like image 948
VagrantAI Avatar asked Oct 28 '22 21:10

VagrantAI


1 Answers

tasks.json version 2.0.0 edit:

{
    "label": "%name%",
    "type": "shell",
    "command": "Start-Process -FilePath \"%path to bat%\"",
    "presentation": {
        "reveal": "never"
    },
    "problemMatcher": [],
    "group": {
        "kind": "build",
        "isDefault": true
    }
},

For older tasks.json version: So, while vscode uses PowerShell as main environment on windows, next piece worked for me:

"command": "Start-Process -FilePath \"path to script\"",
"presentation": {
    "reveal": "never"
},
like image 130
VagrantAI Avatar answered Nov 17 '22 09:11

VagrantAI