Coder Social home page Coder Social logo

samwallace04 / restore-terminals-vscode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ethansk/restore-terminals-vscode

0.0 0.0 0.0 162 KB

A VSCode extension to restore/startup terminals with a custom configuration

Home Page: https://marketplace.visualstudio.com/items?itemName=EthanSK.restore-terminals

TypeScript 100.00%

restore-terminals-vscode's Introduction

Restore Terminals

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"],
          "color": "blue",
          "icon": "accounts-view-bar-icon"
        },
        {
          "name": "client",
          "commands": ["npm run dev:client"]
        },
        {
          "name": "test",
          "commands": ["jest --watch"]
        }
      ]
    },
    {
      "profile": "Git Bash"
      "splitTerminals": [
        {
          "name": "build & e2e",
          "commands": ["npm run eslint", "npm run build", "npm run e2e"],
          "shouldRunCommands": false
        },
        {
          "name": "worker",
          "commands": ["npm-run-all --parallel redis tsc-watch-start worker"]
        }
      ]
    }
  ]

The list of colors supported are:

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

The list of icons supported can be found in the vscode docs. Both the 'identifier' and 'default codicon ID' will work.

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.

You can also use a custom config file under. The file should be at .vscode/restore-terminals.json in any workspace you want. A sample config file is here. If this config file is present, Restore Terminals will try and load settings from it first, then use settings.json as a fallback.

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 want the commands to actually run, just be pasted in the terminal, then set shouldRunCommands to false in each splitTerminals object.

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.