All Projects → fabiospampinato → vscode-terminals

fabiospampinato / vscode-terminals

Licence: MIT license
An extension for setting-up multiple terminals at once, or just running some commands.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vscode-terminals

spdlog setup
spdlog setup initialization via file configuration for convenience.
Stars: ✭ 68 (-18.07%)
Mutual labels:  setup
Windows-Python-RAT
A New Microsoft Windows Remote Administrator Tool [RAT] with Python by Sir.4m1R.
Stars: ✭ 70 (-15.66%)
Mutual labels:  setup
cpsetup
Intuitive bash/shell script to setup and harden/configure cPanel CentOS/RHEL server with ConfigServer Firewall, MailManage, MailQueue, Malware Detect, ClamAV, mod_cloudflare, CloudFlare RailGun, and many more applications and security tweaks
Stars: ✭ 42 (-49.4%)
Mutual labels:  setup
fastfreeze
Turn-key solution to checkpoint/restore applications running in Linux containers
Stars: ✭ 68 (-18.07%)
Mutual labels:  restore
lrkFM
Awesome, (ad) free, open source file manager for Android
Stars: ✭ 44 (-46.99%)
Mutual labels:  manager
shellops-api
Shellops API ( NestJS ). Assists in managing Docker on your server.
Stars: ✭ 17 (-79.52%)
Mutual labels:  manager
NodeJS-Red-Team-Cheat-Sheet
NodeJS Red-Team Cheat Sheet
Stars: ✭ 121 (+45.78%)
Mutual labels:  command
cli
Aplus Framework CLI Library
Stars: ✭ 104 (+25.3%)
Mutual labels:  command
startuptoolbox
The startup founder toolbelt. A forever-updating crowdsourced collection.
Stars: ✭ 146 (+75.9%)
Mutual labels:  startup
travis
⛔ ARCHIVED ⛔ Set Up 'Travis' for Testing and Deployment
Stars: ✭ 61 (-26.51%)
Mutual labels:  setup
events-manager-io
A basic site for managing event centers and scheduling events.
Stars: ✭ 19 (-77.11%)
Mutual labels:  manager
mac-dev-setup
An easy script to install your mac dev environment
Stars: ✭ 38 (-54.22%)
Mutual labels:  setup
equine
Mod manager/launcher for Diablo 1
Stars: ✭ 27 (-67.47%)
Mutual labels:  manager
ovh-manager-web
OVH Control Panel Web UI — Official Repository
Stars: ✭ 61 (-26.51%)
Mutual labels:  manager
ucollage
An extensible command line image viewer inspired by vim
Stars: ✭ 161 (+93.98%)
Mutual labels:  command
eerie
The package manager for Io.
Stars: ✭ 22 (-73.49%)
Mutual labels:  manager
sphobjinv
Toolkit for manipulation and inspection of Sphinx objects.inv files
Stars: ✭ 53 (-36.14%)
Mutual labels:  manager
KJNetworkPlugin
🎡A lightweight but powerful Network library. Network Plugin, Support batch and chain operation. 插件版网络架构
Stars: ✭ 43 (-48.19%)
Mutual labels:  manager
Osiris-pwm
A simple and lightweight encrypted password manager written in Go.
Stars: ✭ 32 (-61.45%)
Mutual labels:  manager
database
Simple and easy go database micro framework
Stars: ✭ 12 (-85.54%)
Mutual labels:  command

Terminals Manager

Logo

An extension for setting-up multiple terminals at once, or just running some commands.

The extension is configured using a very easy to edit JSON file.

Check the demo below to learn more.

Install

Follow the instructions in the Marketplace, or run the following in the command palette:

ext install fabiospampinato.vscode-terminals

Usage

It adds 4 new commands to the command palette:

Terminals: Edit Configuration // Open the configuration file, it will create it for you if needed
Terminals: Kill // Kill all the terminals
Terminals: Run // Run all the terminals
Terminals: Run Single // Select a single terminal to run

It adds 1 shortcut:

'Cmd/Ctrl+Alt+T' // Triggers `Terminals: Run Single`

Settings

{
  "terminals.invertCommandsAndDescription": false, // Invert a terminal commands and description in the quickpick
  "terminals.showCommands": false, // Show terminals' commands in the quickpick
  "terminals.showDescriptions": true, // Show terminals' descriptions in the quickpick
  "terminals.sortTerminals": false, // Sort terminals alphabetically
  "terminals.env": {}, // Global environment variables that will be applied to all terminals
  "terminals.multiplexer": "screen" // The terminal multiplexer to use for persistent terminals, supported values are: "screen", "tmux"
}

Configuration

Run the Terminals: Edit Configuration command to create the configuration file. By default it uses a file named terminals.json under the .vscode directory, you can change this by supplying a custom path using the terminals.configPath setting entry.

The configuration is an object that looks like this:

{
  "autorun": true, // Execute `Terminals: Run` automatically at startup or when the project is added to the workspace
  "autokill": true, // Kill all the terminals created from this configuration when the project is removed from the workspace
  "env": { "name": "value" }, // Global environment variables that will be applied to all terminals
  "terminals": [ // Array of terminals to open
    { // An object describing a terminal, most entries are optional

      "name": "My Terminal", // The name of the terminal, it will be displayed in the dropdown
      "description": "A terminal that runs some commands", // The description of the terminal
      "icon": "code", // An icon to show next to the name
      "color": "terminal.ansiCyan", // A themeable color, ref: https://code.visualstudio.com/api/references/theme-color
      "cwd": "/Users/fabio/Desktop", // A path for the current working directory to be used for the terminal
      "command": "whoami", // Single command to run
      "commands": [ // Multiple commands to run
        "cd to/my/chest",
        "touch my_heart"
      ],

      "target": "My Other Terminal",// Execute the commands in this terminal's instance
      "persistent": "unique_session_name", // Keep the process running even when closing the terminal and reuse it, preservig the output. The unique session name will be passed to the terminal multiplexer
      "substitution": false, // Disable variable substitution for this terminal
      "recycle": false, // Always create a new terminal
      "open": true, // Open the terminal after executing its commands
      "focus": true, // Open the terminal after executing its commands and focus to it
      "execute": false, // Write the last command without executing it

      "onlySingle": true, // Don't run this with the `Terminals: Run` command
      "onlyMultiple": true, // Hide it from the `Terminals: Run Single` command
      "onlyAPI": true, // Don't run this with the `Terminals: Run` command and hide it from the `Terminals: Run Single` command

      "shellPath": '/bin/bash', // Path to a custom shell executable
      "shellArgs": ["--foo"], // Arguments to pass to the shell executable
      "env": { "name": "value" }, // Environment variables that will be applied to this terminal
      "envInherit": false // Don't inherit global environment variables

    }
  ]
}

Environment variables are expected to be strings.

You can also define terminals in your Visual Studio Code settings file under the key terminals.terminals. This way you can have global terminals, which are always available, while still having the ability to add some project-specific terminals in your configuration file.

Persistent Terminals

Persistent terminals are achieved by saving sessions, and reattaching to them, using your terminal multiplexer of choice.

The currently supported terminal multiplexers are GNU Screen and tmux.

You must have the terminal multiplexer setted in the terminals.multiplexer setting installed in your system for this to work:

  • Linux/macOS: your system probably comes with both screen and tmux installed by default.
  • Windows: you can install them via cygwin or WSL.

Note: a terminal multiplexer usually modifies the way a terminal work. For instance ctrl+a usually means "go to the beginning of the line" inside a terminal, but inside screen, ctrl+a doesn't work this way. You might want to configure your terminal multiplexer to best suit your needs.

Note: this is an experimental feature, you may encounter some bugs.

Variable Substitution

This extension supports some special tokens that you can put in your configuration, they will be substituted with the appropriate value when you execute the terminal. This is especially useful for defining global terminals. Here they are:

Token Value
[workspaceFolder] The path of the workspace folder that contains the active file
[workspaceFolderBasename] The name of the workspace folder that contains the active file without any slashes (/)
[file] The current opened file
[relativeFile] The current opened file relative to the workspace folder containing the file
[fileBasename] The current opened file's basename
[fileBasenameNoExtension] The current opened file's basename without the extension
[fileDirname] The current opened file's dirname
[fileExtname] The current opened file's extension
[cwd] The current working directory on startup
[lineNumber] The current selected line number in the active file

Demo

Edit Configuration + Run

Run

Run Single

Run Single

Persistent

Persistent

Hints

  • Commands: Use this other extension, the terminals.runTerminalByName command and, optionally, the onlyAPI configuration option to create terminals that can be run with a click from the statusbar.
  • Self-destroying terminals: it's a common use case to run some commands and then close the terminal, to do this simply put an exit 0 command at the end of your commands list.
  • Icons: here you can browse a list of supported icons. If for instance you click the first icon, you'll get a page with .octicon-alert written in it, to get the string to use simply remove the .octicon- part, so in this case the icon name would be alert.

Contributing

If you found a problem, or have a feature request, please open an issue about it.

If you want to make a pull request you can debug the extension using Debug Launcher.

License

MIT © Fabio Spampinato

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].