fabiospampinato / vscode-terminals

An extension for setting-up multiple terminals at once, or just running some commands.
MIT License
121 stars 19 forks source link

Add `terminals.runTerminalByName` to `context.subscriptions` #82

Closed cssinate closed 11 months ago

cssinate commented 11 months ago

As an alternative to https://github.com/fabiospampinato/vscode-terminals/issues/12 - I might be mistaken here, but if you added the terminals.runTerminalByName command to context.subscriptions then users could do something in keybindings.json like:

{
  "command": "runCommands",
  "key": "someKeyBinding",
  "args": [
      "terminals.runTerminalByName(\"First Term\")",
      "terminals.runTerminalByName(\"Second Term\")",
    ]
  }
cssinate commented 11 months ago

I've just seen https://github.com/fabiospampinato/vscode-terminals/issues/30 - is this considered a duplicate? They're certainly related.

cssinate commented 11 months ago

Nevermind. My understanding of the syntax was incorrect. This works:

  {
    "command": "runCommands",
    "key": "someKeyBinding",
    "args": {
      "commands": [
        { 
          "command": "terminals.runTerminalByName",
          "args": "First Term"
        },
        {
          "command": "terminals.runTerminalByName",
          "args": "Second Term"
        }
      ]
    }
  }