0

Command for joining terminals: workbench.action.terminal.joinInstance.

Necessary conditions I can think of:

  1. Terminal tabs are focused.
  2. Two or more terminals are selected in the terminal tabs.

The best I came up with is:

terminalProcessSupported && terminalTabsFocus && !terminalTabsSingularSelection

But the above is not the same as terminalTabsMultipleSelections (which doesn't exist).

Wenfang Du
  • 8,804
  • 9
  • 59
  • 90
  • `terminalTabsSingularSelection` is not mentioned at the when-clause doc page – rioV8 Jun 19 '21 at 12:05
  • @rioV8 It's already been used by `workbench.action.terminal.renameInstance`. – Wenfang Du Jun 19 '21 at 12:18
  • There is https://github.com/microsoft/vscode/blob/074b02d04b77bf8710dd49dd13383b5e244ae4c5/src/vs/workbench/contrib/terminal/common/terminal.ts but I don't see anything helpful there. – Mark Jun 19 '21 at 20:17

1 Answers1

1

With this fix in place, it's now safe to use terminalProcessSupported && terminalTabsFocus instead.


The original answer:

According to Daniel Imms's comment:

We use internally to make it work in the context menu terminalProcessSupported && !terminalTabsSingularSelection

And the source code in this regard:

precondition: ContextKeyExpr.and(
  KEYBINDING_CONTEXT_TERMINAL_PROCESS_SUPPORTED,
  KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION.toNegated(),
)

So for now, it's still best to use terminalProcessSupported && terminalTabsFocus && !terminalTabsSingularSelection.

Wenfang Du
  • 8,804
  • 9
  • 59
  • 90