使用命名终端启动 VScode 并准备启动命令

发布于 2025-01-16 13:24:18 字数 271 浏览 2 评论 0原文

每次我打开包含多个项目的 vsCode 项目时,我都需要打开多个终端并使用命令“yarn:start”。我还用项目名称重命名它们,因为默认情况下它们都有名称 name (在我的例子中是 powershell,然后是启动命令时的 node)。

我有两个问题:

  1. 有没有办法打开预定义的终端列表,并为每个项目预定义名称。
  2. 有没有办法在每个终端中输入命令,无论是否启动命令。

感谢您的帮助!

Everytime I open my vsCode project with multiple projects inside, I need to open multiple terminals and use the command "yarn <project_name>:start". I also rename them with the project name because they all have the name name by default (powershell in my case, then node when the command is launched).

I have 2 questions:

  1. Is there a way to open a predefined list of terminals with a predefined name for each project.
  2. Is there a way to input the command in each terminal with or without lauching the command.

Thank you for your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

删除会话 2025-01-23 13:24:18

使用 vscode 任务,我能够添加 2 个任务,并在每次打开工作区时自动激活的另一个任务中将它们一起调用。

{
    "label": "Start Dev",
    "runOptions": {
        "runOn": "folderOpen"
    },
    "dependsOn": ["Common", "Hub"]
},
{
    "label": "Common",
    "type": "shell",
    "command": "yarn dev:common",
    "windows": {
        "command": "yarn dev:common"
    },
    "group": "none",
    "presentation": {
        "reveal": "always",
        "panel": "new"
    }
},
{
    "label": "Hub",
    "type": "shell",
    "command": "yarn dev:hub",
    "windows": {
        "command": "yarn dev:hub"
    },
    "group": "none",
    "presentation": {
        "reveal": "always",
        "panel": "new"
    }
}

Using vscode tasks, I was able to add 2 tasks and call them together in another tasks that activates automatically on everytime I open the workspace.

{
    "label": "Start Dev",
    "runOptions": {
        "runOn": "folderOpen"
    },
    "dependsOn": ["Common", "Hub"]
},
{
    "label": "Common",
    "type": "shell",
    "command": "yarn dev:common",
    "windows": {
        "command": "yarn dev:common"
    },
    "group": "none",
    "presentation": {
        "reveal": "always",
        "panel": "new"
    }
},
{
    "label": "Hub",
    "type": "shell",
    "command": "yarn dev:hub",
    "windows": {
        "command": "yarn dev:hub"
    },
    "group": "none",
    "presentation": {
        "reveal": "always",
        "panel": "new"
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文