Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Unmaintained, the original repo is now active!

Notifications You must be signed in to change notification settings

lu0/restore-terminals-vscode

 
 

Repository files navigation

Restore Terminals

Forked to be useful on kind-of-slow systems. The extension used to fail to restore my terminals most of the time.

Local usage

Compilation

npm install
npm run compile

Packaging & installation

# Package the extension
sudo npm i -g vsce
vsce package

# Install the extension
code --install-extension *.vsix

Below is EthanSK's original Readme file:

Automatically spawn integrated terminal windows and split terminals, and run >any shell commands when VSCode starts up!

How to use

Simply configure your VSCode settings JSON file to look something like this:

"restoreTerminals.terminals": [
   {
     "splitTerminals": [
       {
         "name": "server",
         "commands": ["npm i", "npm run dev"]
       },
       {
         "name": "client",
         "commands": ["npm run dev:client"]
       },
       {
         "name": "test",
         "commands": ["jest --watch"]
       }
     ]
   },
   {
     "splitTerminals": [
       {
         "name": "build & e2e",
         "commands": ["npm run eslint", "npm run build", "npm run e2e"]
       },
       {
         "name": "worker",
         "commands": ["npm-run-all --parallel redis tsc-watch-start worker"]
       }
     ]
   }
 ]

The outer array represents a integrated VSCode terminal window, and the >splitTerminals array contains the information about how each terminal >window should be split up.

Extra info

The order of split terminals from left to right is the order in the array.

You can manually trigger the restoration of terminals by running Restore >Terminals in the command palette.

If you find the extension glitching out, try increasing the >restoreTerminals.artificialDelayMilliseconds setting to a higher number, >such as 1000.

If you do not want this extension to close the currently open terminal >windows, you can simply set restoreTerminals.keepExistingTerminalsOpen to >true.

If you do not want it to restore terminals on VSCode startup, but instead >only run when you trigger it manually from the command palette, then set >restoreTerminals.runOnStartup to false.

If you don't like using split terminals, then just provide one object in >each split terminal array, which should be the intuitive thing to do.

Contributions to the code are very welcome and much appreciated!

Enjoy!

Releases

No releases published

Languages

  • TypeScript 99.0%
  • Shell 1.0%