首页 > 解决方案 > 如何编写不等待进程完成的 VS Code 任务?

问题描述

我想做一个任务,它将构建一个项目并在 pdf 查看器中打开生成的 pdf 文件:

"tasks": [
    {
        "label": "Build",
        "type": "shell",
        "command": "make",
    },
    {
        "label": "Build and View",
        "type": "process",
        "command": "evince",
        "args": [
            "_build/document.pdf"
        ],
        "dependsOn": ["Build"],
        "group": {
            "kind": "build",
            "isDefault": true
        }
    }
]

但它使 VS Code 等到 pdf 查看器进程存在。这不是我想要的。此外,当我再次运行任务时,我得到

在此处输入图像描述

标签: visual-studio-code

解决方案


推荐阅读