Skip to content

Instantly share code, notes, and snippets.

@qpwo
Created September 18, 2024 19:34
Show Gist options
  • Save qpwo/c3033b6bc9996a3ef3f674567f0dfc1a to your computer and use it in GitHub Desktop.
Save qpwo/c3033b6bc9996a3ef3f674567f0dfc1a to your computer and use it in GitHub Desktop.
vscode run selection in BOTH terminals

Step 1: install the multicommand extension: ryuta46.multi-command https://marketplace.visualstudio.com/items?itemName=ryuta46.multi-command

Step 2: add to settings.json:

  "multiCommand.commands": [
    {
      "command": "multiCommand.runInBothTerminals",
      "interval": 30,
      "sequence": [
        "workbench.action.terminal.runSelectedText",
        "workbench.action.terminal.focusNextPane",
        "workbench.action.terminal.runSelectedText",
      ]
    }
  ],

step 3: add to keybindings.json:

  {
    "key": "ctrl+shift+enter",
    "command": "extension.multiCommand.execute",
    "args": {
      "command": "multiCommand.runInBothTerminals"
    },
    "when": "editorTextFocus"
  },

just press ctrl shift enter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment