将终端选项卡保存到已保存的工作区 VSCode [英] Save terminal tabs to saved workspace VSCode

查看:47
本文介绍了将终端选项卡保存到已保存的工作区 VSCode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将终端设置保存到工作区?对于我的大多数项目,我总是打开两个终端选项卡.一种是我完成所有 git 工作,另一种是我运行 gulp 任务.这是两个不同的文件夹,都不是项目根目录.当我打开一个保存的工作区时,它总是只打开一个指向项目根目录的选项卡.

Is it possible to save Terminal settings to a workspace? For most of my projects I always have two terminal tabs open. One where I do all of my git work and one where I run gulp tasks. These are two different folders and neither are the project root. When I open a saved workspace it always just opens one tab to the project root.

推荐答案

恢复终端扩展.例如,在您的 settings.json 中:

Look at the Restore Terminals extension. For example, in your settings.json:

 "restoreTerminals.runOnStartup": false,   // true is the default
          // set to false if using a keybinding or command palette

  "restoreTerminals.terminals": [
    {
      "splitTerminals": [
        {
          "name": "git",
          "commands": [
            "cd <your directory>",
            "npm run test"         // your git command(s)
          ]
        }
      ]
    },
    {
      "splitTerminals": [
        {
          "name": "gulp",
          "commands": [
            "cd zip",
            "gulp sass"
          ]
        }
      ]
    }
  ]

将打开两个终端,一个用于您的 git 工作,另一个用于 gulp 工作.他们每个人都可以接受多个命令.

will open two terminals, one for your git work and one for the gulp work. They can each take multiple commands.

示例键绑定:

{
  "key": "shift+alt+t",    // whatever keybinding if you wish
  "command": "restore-terminals.restoreTerminals",
},

或者你可以在启动时运行.

or you can it run at start-up.

这篇关于将终端选项卡保存到已保存的工作区 VSCode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆