Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 通过tasks 2.0.0在外部终端中启动vscode任务_Windows_Visual Studio Code_Vscode Tasks - Fatal编程技术网

Windows 通过tasks 2.0.0在外部终端中启动vscode任务

Windows 通过tasks 2.0.0在外部终端中启动vscode任务,windows,visual-studio-code,vscode-tasks,Windows,Visual Studio Code,Vscode Tasks,是否可以通过外部终端而不是vscode终端内部启动bat文件 任务示例: { "label": "Build", "type": "shell", "command": "./build.bat", "presentation": { "reveal": "always", "panel": "new" }, "problemMatcher": [], "group": { "kind": "

是否可以通过外部终端而不是vscode终端内部启动bat文件

任务示例:

{
    "label": "Build",
    "type": "shell",
    "command": "./build.bat",
    "presentation": {
        "reveal": "always",
        "panel": "new"
    },
    "problemMatcher": [],
    "group": {
        "kind": "build",
        "isDefault": true
    }
}

tasks.json版本2.0.0编辑:

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

对于较旧的tasks.json版本: 所以,虽然vscode在windows上使用PowerShell作为主环境,但下一部分对我来说很有用:

"command": "Start-Process -FilePath \"path to script\"",
"presentation": {
    "reveal": "never"
},

您好,请详细说明是什么使您的流程在外部终端中打开。谢谢:)看来你的答案在其他操作系统上是行不通的windows@538ROMEO没错,答案是基于windows环境专有的powershell