Save terminal tabs to saved workspace VSCode

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"
          ]
        }
      ]
    }
  ]

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

Example keybinding:

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

or you can it run at start-up.

Leave a Comment