From c7ef4d2fe7f5cfffcbe9390e3d1c08b44f5b2466 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 19 Oct 2021 13:14:09 -0700 Subject: [PATCH 1/3] fix #129257 --- .../terminal/browser/terminalActions.ts | 129 +++++++++--------- .../terminal/browser/terminalService.ts | 5 + .../terminal/common/terminalContextKey.ts | 4 + 3 files changed, 74 insertions(+), 64 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts index cff91bb675523..2f389f5130e59 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts @@ -181,7 +181,7 @@ export function registerTerminalActions() { title: terminalStrings.moveToEditor, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -197,7 +197,7 @@ export function registerTerminalActions() { title: terminalStrings.moveToEditor, f1: false, category, - precondition: ContextKeyExpr.and(TerminalContextKeys.processSupported, TerminalContextKeys.isOpen) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen) }); } async run(accessor: ServicesAccessor) { @@ -219,7 +219,8 @@ export function registerTerminalActions() { id: TerminalCommandId.MoveToTerminalPanel, title: terminalStrings.moveToTerminalPanel, f1: true, - category + category, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor, resource: unknown) { @@ -235,7 +236,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.showTabs', "Show Tabs"), original: 'Show Tabs' }, f1: false, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -260,7 +261,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -286,7 +287,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -308,7 +309,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -328,7 +329,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -347,7 +348,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -366,7 +367,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -380,7 +381,7 @@ export function registerTerminalActions() { title: terminalStrings.focus, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -406,7 +407,7 @@ export function registerTerminalActions() { weight: KeybindingWeight.WorkbenchContrib, when: ContextKeyExpr.or(TerminalContextKeys.tabsFocus, TerminalContextKeys.focus), }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -420,7 +421,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.focusNext', "Focus Next Terminal Group"), original: 'Focus Next Terminal Group' }, f1: true, category, - precondition: TerminalContextKeys.processSupported, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), keybinding: { primary: KeyMod.CtrlCmd | KeyCode.PageDown, mac: { @@ -444,7 +445,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.focusPrevious', "Focus Previous Terminal Group"), original: 'Focus Previous Terminal Group' }, f1: true, category, - precondition: TerminalContextKeys.processSupported, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), keybinding: { primary: KeyMod.CtrlCmd | KeyCode.PageUp, mac: { @@ -500,7 +501,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.runActiveFile', "Run Active File In Active Terminal"), original: 'Run Active File In Active Terminal' }, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -547,7 +548,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -567,7 +568,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -587,7 +588,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -607,7 +608,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -627,7 +628,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -647,7 +648,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -729,7 +730,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.textSelected, TerminalContextKeys.notFindVisible), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -746,7 +747,7 @@ export function registerTerminalActions() { title: terminalStrings.changeIcon, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor, resource: unknown) { @@ -760,7 +761,7 @@ export function registerTerminalActions() { title: terminalStrings.changeIcon, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -774,7 +775,7 @@ export function registerTerminalActions() { title: terminalStrings.changeIcon, f1: false, category, - precondition: ContextKeyExpr.and(TerminalContextKeys.processSupported, TerminalContextKeys.tabsSingularSelection) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.tabsSingularSelection) }); } async run(accessor: ServicesAccessor) { @@ -788,7 +789,7 @@ export function registerTerminalActions() { title: terminalStrings.changeColor, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor, resource: unknown) { @@ -802,7 +803,7 @@ export function registerTerminalActions() { title: terminalStrings.changeColor, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -816,7 +817,7 @@ export function registerTerminalActions() { title: terminalStrings.changeColor, f1: false, category, - precondition: ContextKeyExpr.and(TerminalContextKeys.processSupported, TerminalContextKeys.tabsSingularSelection) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.tabsSingularSelection) }); } async run(accessor: ServicesAccessor) { @@ -830,7 +831,7 @@ export function registerTerminalActions() { title: terminalStrings.rename, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor, resource: unknown) { @@ -845,7 +846,7 @@ export function registerTerminalActions() { title: terminalStrings.rename, f1: false, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -867,7 +868,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.tabsFocus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.and(TerminalContextKeys.processSupported, TerminalContextKeys.tabsSingularSelection), + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.tabsSingularSelection), }); } async run(accessor: ServicesAccessor) { @@ -907,7 +908,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.or(TerminalContextKeys.findFocus, TerminalContextKeys.focus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -927,7 +928,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.findVisible), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1008,7 +1009,7 @@ export function registerTerminalActions() { title: { value: localize('quickAccessTerminal', "Switch Active Terminal"), original: 'Switch Active Terminal' }, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1027,7 +1028,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1049,7 +1050,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1071,7 +1072,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1093,7 +1094,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1110,7 +1111,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.selectToPreviousLine', "Select To Previous Line"), original: 'Select To Previous Line' }, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1127,7 +1128,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.selectToNextLine', "Select To Next Line"), original: 'Select To Next Line' }, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1248,7 +1249,7 @@ export function registerTerminalActions() { } }] }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor, args?: { name?: string }) { @@ -1273,7 +1274,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.or(TerminalContextKeys.focus, TerminalContextKeys.findFocus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1296,7 +1297,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.or(TerminalContextKeys.focus, TerminalContextKeys.findFocus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1319,7 +1320,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.or(TerminalContextKeys.focus, TerminalContextKeys.findFocus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1349,7 +1350,7 @@ export function registerTerminalActions() { weight: KeybindingWeight.WorkbenchContrib } ], - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1376,7 +1377,7 @@ export function registerTerminalActions() { weight: KeybindingWeight.WorkbenchContrib } ], - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } run(accessor: ServicesAccessor) { @@ -1528,7 +1529,7 @@ export function registerTerminalActions() { title: terminalStrings.unsplit, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -1542,7 +1543,7 @@ export function registerTerminalActions() { title: terminalStrings.unsplit, f1: false, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -1564,7 +1565,7 @@ export function registerTerminalActions() { id: TerminalCommandId.JoinInstance, title: { value: localize('workbench.action.terminal.joinInstance', "Join Terminals"), original: 'Join Terminals' }, category, - precondition: ContextKeyExpr.and(TerminalContextKeys.processSupported, TerminalContextKeys.tabsSingularSelection.toNegated()) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.tabsSingularSelection.toNegated()) }); } async run(accessor: ServicesAccessor) { @@ -1603,7 +1604,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.selectAll', "Select All"), original: 'Select All' }, f1: true, category, - precondition: TerminalContextKeys.processSupported, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), keybinding: [{ // Don't use ctrl+a by default as that would override the common go to start // of prompt shell binding @@ -1628,7 +1629,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.new', "Create New Terminal"), original: 'Create New Terminal' }, f1: true, category, - precondition: TerminalContextKeys.processSupported, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.webExtensionContributedProfile), icon: Codicon.plus, keybinding: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Backquote, @@ -1709,7 +1710,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.kill', "Kill the Active Terminal Instance"), original: 'Kill the Active Terminal Instance' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.isOpen), + precondition: ContextKeyExpr.or(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen), icon: Codicon.trash }); } @@ -1733,7 +1734,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.killEditor', "Kill the Active Terminal in Editor Area"), original: 'Kill the Active Terminal in Editor Area' }, f1: true, category, - precondition: TerminalContextKeys.processSupported, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), keybinding: { primary: KeyMod.CtrlCmd | KeyCode.KeyW, win: { primary: KeyMod.CtrlCmd | KeyCode.F4, secondary: [KeyMod.CtrlCmd | KeyCode.KeyW] }, @@ -1755,7 +1756,7 @@ export function registerTerminalActions() { title: terminalStrings.kill, f1: false, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.isOpen), + precondition: ContextKeyExpr.or(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen), keybinding: { primary: KeyCode.Delete, mac: { @@ -1789,7 +1790,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.clear', "Clear"), original: 'Clear' }, f1: true, category, - precondition: TerminalContextKeys.processSupported, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), keybinding: [{ primary: 0, mac: { primary: KeyMod.CtrlCmd | KeyCode.KeyK }, @@ -1840,7 +1841,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.openSettings', "Configure Terminal Settings"), original: 'Configure Terminal Settings' }, f1: true, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor) { @@ -1855,7 +1856,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.setFixedDimensions', "Set Fixed Dimensions"), original: 'Set Fixed Dimensions' }, f1: true, category, - precondition: TerminalContextKeys.isOpen + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen) }); } async run(accessor: ServicesAccessor) { @@ -1870,7 +1871,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.sizeToContentWidth', "Toggle Size to Content Width"), original: 'Toggle Size to Content Width' }, f1: true, category, - precondition: ContextKeyExpr.and(TerminalContextKeys.processSupported, TerminalContextKeys.isOpen, TerminalContextKeys.focus), + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen, TerminalContextKeys.focus), keybinding: { primary: KeyMod.Alt | KeyCode.KeyZ, weight: KeybindingWeight.WorkbenchContrib @@ -1888,7 +1889,7 @@ export function registerTerminalActions() { title: terminalStrings.toggleSizeToContentWidth, f1: false, category, - precondition: ContextKeyExpr.and(TerminalContextKeys.processSupported, TerminalContextKeys.focus) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.focus) }); } async run(accessor: ServicesAccessor) { @@ -1905,7 +1906,7 @@ export function registerTerminalActions() { f1: true, category, // TODO: Why is copy still showing up when text isn't selected? - precondition: ContextKeyExpr.and(TerminalContextKeys.processSupported, TerminalContextKeys.textSelected), + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.textSelected), keybinding: [{ primary: KeyMod.CtrlCmd | KeyCode.KeyC, win: { primary: KeyMod.CtrlCmd | KeyCode.KeyC, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyC] }, @@ -1929,7 +1930,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.paste', "Paste into Active Terminal"), original: 'Paste into Active Terminal' }, f1: true, category, - precondition: TerminalContextKeys.processSupported, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), keybinding: [{ primary: KeyMod.CtrlCmd | KeyCode.KeyV, win: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyV] }, @@ -1953,7 +1954,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.pasteSelection', "Paste Selection into Active Terminal"), original: 'Paste Selection into Active Terminal' }, f1: true, category, - precondition: TerminalContextKeys.processSupported, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), keybinding: [{ linux: { primary: KeyMod.Shift | KeyCode.Insert }, weight: KeybindingWeight.WorkbenchContrib, @@ -1975,7 +1976,7 @@ export function registerTerminalActions() { title: switchTerminalTitle, f1: false, category, - precondition: TerminalContextKeys.processSupported + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) }); } async run(accessor: ServicesAccessor, item?: string) { @@ -2084,7 +2085,7 @@ export function refreshTerminalActions(detectedProfiles: ITerminalProfile[]) { title: { value: localize('workbench.action.terminal.newWithProfile', "Create New Terminal (With Profile)"), original: 'Create New Terminal (With Profile)' }, f1: true, category, - precondition: TerminalContextKeys.processSupported, + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.webExtensionContributedProfile), description: { description: 'workbench.action.terminal.newWithProfile', args: [{ diff --git a/src/vs/workbench/contrib/terminal/browser/terminalService.ts b/src/vs/workbench/contrib/terminal/browser/terminalService.ts index efc09b723dd71..3f23c6fe07d59 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalService.ts @@ -65,6 +65,7 @@ export class TerminalService implements ITerminalService { private _linkProviderDisposables: Map = new Map(); private _processSupportContextKey: IContextKey; private _webExtensionContributedProfileContextKey: IContextKey; + private _terminalHasBeenCreated: IContextKey; private readonly _localTerminalService?: ILocalTerminalService; private readonly _primaryOffProcessTerminalService?: IOffProcessTerminalService; private _defaultProfileName?: string; @@ -254,6 +255,7 @@ export class TerminalService implements ITerminalService { this._processSupportContextKey = TerminalContextKeys.processSupported.bindTo(this._contextKeyService); this._processSupportContextKey.set(!isWeb || this._remoteAgentService.getConnection() !== null); this._webExtensionContributedProfileContextKey = TerminalContextKeys.webExtensionContributedProfile.bindTo(this._contextKeyService); + this._terminalHasBeenCreated = TerminalContextKeys.terminalHasBeenCreated.bindTo(this._contextKeyService); lifecycleService.onBeforeShutdown(async e => e.veto(this._onBeforeShutdown(e.reason), 'veto.terminal')); lifecycleService.onWillShutdown(e => this._onWillShutdown(e)); @@ -1264,6 +1266,7 @@ export class TerminalService implements ITerminalService { const instanceHost = resolvedLocation === TerminalLocation.Editor ? this._terminalEditorService : this._terminalGroupService; const instance = instanceHost.instances[instanceHost.instances.length - 1]; await instance.focusWhenReady(); + this._terminalHasBeenCreated.set(true); return instance; } @@ -1280,12 +1283,14 @@ export class TerminalService implements ITerminalService { this._backgroundedTerminalDisposables.set(instance.instanceId, [ instance.onDisposed(this._onDidDisposeInstance.fire, this._onDidDisposeInstance) ]); + this._terminalHasBeenCreated.set(true); return instance; } this._evaluateLocalCwd(shellLaunchConfig); const location = this.resolveLocation(options?.location) || this.defaultLocation; const parent = this._getSplitParent(options?.location); + this._terminalHasBeenCreated.set(true); if (parent) { return this._splitTerminal(shellLaunchConfig, location, parent); } diff --git a/src/vs/workbench/contrib/terminal/common/terminalContextKey.ts b/src/vs/workbench/contrib/terminal/common/terminalContextKey.ts index c99ddcda3f523..27e79fd4d7824 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalContextKey.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalContextKey.ts @@ -17,6 +17,7 @@ export const enum TerminalContextKeyStrings { EditorFocus = 'terminalEditorFocus', TabsFocus = 'terminalTabsFocus', WebExtensionContributedProfile = 'terminalWebExtensionContributedProfile', + TerminalHasBeenCreated = 'terminalHasBeenCreated', TabsMouse = 'terminalTabsMouse', AltBufferActive = 'terminalAltBufferActive', A11yTreeFocus = 'terminalA11yTreeFocus', @@ -57,6 +58,9 @@ export namespace TerminalContextKeys { /** Whether a web extension has contributed a profile */ export const webExtensionContributedProfile = new RawContextKey(TerminalContextKeyStrings.WebExtensionContributedProfile, false, true); + /** Whether at least one terminal has been created */ + export const terminalHasBeenCreated = new RawContextKey(TerminalContextKeyStrings.TerminalHasBeenCreated, false, true); + /** Whether the mouse is within the terminal tabs list. */ export const tabsMouse = new RawContextKey(TerminalContextKeyStrings.TabsMouse, false, true); From 28024d5423e47b485efde6f7c9334d2cd798b64d Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 19 Oct 2021 15:40:36 -0500 Subject: [PATCH 2/3] Update src/vs/workbench/contrib/terminal/browser/terminalActions.ts Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> --- src/vs/workbench/contrib/terminal/browser/terminalActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts index 2f389f5130e59..710117059abf4 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts @@ -1930,7 +1930,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.paste', "Paste into Active Terminal"), original: 'Paste into Active Terminal' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), keybinding: [{ primary: KeyMod.CtrlCmd | KeyCode.KeyV, win: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyV] }, From cb28397332c7ab8df383af3bde4e88df12044c2b Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 19 Oct 2021 13:41:30 -0700 Subject: [PATCH 3/3] remove webExtensionContributedProfile --- .../terminal/browser/terminalActions.ts | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts index 710117059abf4..bf78f5916d764 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts @@ -181,7 +181,7 @@ export function registerTerminalActions() { title: terminalStrings.moveToEditor, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -197,7 +197,7 @@ export function registerTerminalActions() { title: terminalStrings.moveToEditor, f1: false, category, - precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.isOpen) }); } async run(accessor: ServicesAccessor) { @@ -220,7 +220,7 @@ export function registerTerminalActions() { title: terminalStrings.moveToTerminalPanel, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor, resource: unknown) { @@ -236,7 +236,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.showTabs', "Show Tabs"), original: 'Show Tabs' }, f1: false, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -261,7 +261,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -287,7 +287,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -309,7 +309,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -329,7 +329,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -348,7 +348,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -367,7 +367,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -381,7 +381,7 @@ export function registerTerminalActions() { title: terminalStrings.focus, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -407,7 +407,7 @@ export function registerTerminalActions() { weight: KeybindingWeight.WorkbenchContrib, when: ContextKeyExpr.or(TerminalContextKeys.tabsFocus, TerminalContextKeys.focus), }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -421,7 +421,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.focusNext', "Focus Next Terminal Group"), original: 'Focus Next Terminal Group' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), keybinding: { primary: KeyMod.CtrlCmd | KeyCode.PageDown, mac: { @@ -445,7 +445,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.focusPrevious', "Focus Previous Terminal Group"), original: 'Focus Previous Terminal Group' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), keybinding: { primary: KeyMod.CtrlCmd | KeyCode.PageUp, mac: { @@ -501,7 +501,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.runActiveFile', "Run Active File In Active Terminal"), original: 'Run Active File In Active Terminal' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -548,7 +548,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -568,7 +568,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -588,7 +588,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -608,7 +608,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -628,7 +628,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -648,7 +648,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.altBufferActive.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -730,7 +730,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.textSelected, TerminalContextKeys.notFindVisible), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -747,7 +747,7 @@ export function registerTerminalActions() { title: terminalStrings.changeIcon, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor, resource: unknown) { @@ -761,7 +761,7 @@ export function registerTerminalActions() { title: terminalStrings.changeIcon, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -775,7 +775,7 @@ export function registerTerminalActions() { title: terminalStrings.changeIcon, f1: false, category, - precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.tabsSingularSelection) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.tabsSingularSelection) }); } async run(accessor: ServicesAccessor) { @@ -789,7 +789,7 @@ export function registerTerminalActions() { title: terminalStrings.changeColor, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor, resource: unknown) { @@ -803,7 +803,7 @@ export function registerTerminalActions() { title: terminalStrings.changeColor, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -817,7 +817,7 @@ export function registerTerminalActions() { title: terminalStrings.changeColor, f1: false, category, - precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.tabsSingularSelection) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.tabsSingularSelection) }); } async run(accessor: ServicesAccessor) { @@ -831,7 +831,7 @@ export function registerTerminalActions() { title: terminalStrings.rename, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor, resource: unknown) { @@ -846,7 +846,7 @@ export function registerTerminalActions() { title: terminalStrings.rename, f1: false, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -868,7 +868,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.tabsFocus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.tabsSingularSelection), + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.tabsSingularSelection), }); } async run(accessor: ServicesAccessor) { @@ -908,7 +908,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.or(TerminalContextKeys.findFocus, TerminalContextKeys.focus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -928,7 +928,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.findVisible), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1009,7 +1009,7 @@ export function registerTerminalActions() { title: { value: localize('quickAccessTerminal', "Switch Active Terminal"), original: 'Switch Active Terminal' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1028,7 +1028,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1050,7 +1050,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.and(TerminalContextKeys.focus, CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1072,7 +1072,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1094,7 +1094,7 @@ export function registerTerminalActions() { when: TerminalContextKeys.focus, weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1111,7 +1111,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.selectToPreviousLine', "Select To Previous Line"), original: 'Select To Previous Line' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1128,7 +1128,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.selectToNextLine', "Select To Next Line"), original: 'Select To Next Line' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1249,7 +1249,7 @@ export function registerTerminalActions() { } }] }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor, args?: { name?: string }) { @@ -1274,7 +1274,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.or(TerminalContextKeys.focus, TerminalContextKeys.findFocus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1297,7 +1297,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.or(TerminalContextKeys.focus, TerminalContextKeys.findFocus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1320,7 +1320,7 @@ export function registerTerminalActions() { when: ContextKeyExpr.or(TerminalContextKeys.focus, TerminalContextKeys.findFocus), weight: KeybindingWeight.WorkbenchContrib }, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1350,7 +1350,7 @@ export function registerTerminalActions() { weight: KeybindingWeight.WorkbenchContrib } ], - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1377,7 +1377,7 @@ export function registerTerminalActions() { weight: KeybindingWeight.WorkbenchContrib } ], - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } run(accessor: ServicesAccessor) { @@ -1529,7 +1529,7 @@ export function registerTerminalActions() { title: terminalStrings.unsplit, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -1543,7 +1543,7 @@ export function registerTerminalActions() { title: terminalStrings.unsplit, f1: false, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -1565,7 +1565,7 @@ export function registerTerminalActions() { id: TerminalCommandId.JoinInstance, title: { value: localize('workbench.action.terminal.joinInstance', "Join Terminals"), original: 'Join Terminals' }, category, - precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.tabsSingularSelection.toNegated()) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.tabsSingularSelection.toNegated()) }); } async run(accessor: ServicesAccessor) { @@ -1604,7 +1604,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.selectAll', "Select All"), original: 'Select All' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), keybinding: [{ // Don't use ctrl+a by default as that would override the common go to start // of prompt shell binding @@ -1629,7 +1629,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.new', "Create New Terminal"), original: 'Create New Terminal' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.webExtensionContributedProfile), + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported), icon: Codicon.plus, keybinding: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Backquote, @@ -1710,7 +1710,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.kill', "Kill the Active Terminal Instance"), original: 'Kill the Active Terminal Instance' }, f1: true, category, - precondition: ContextKeyExpr.or(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen), + precondition: ContextKeyExpr.or(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.isOpen), icon: Codicon.trash }); } @@ -1734,7 +1734,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.killEditor', "Kill the Active Terminal in Editor Area"), original: 'Kill the Active Terminal in Editor Area' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), keybinding: { primary: KeyMod.CtrlCmd | KeyCode.KeyW, win: { primary: KeyMod.CtrlCmd | KeyCode.F4, secondary: [KeyMod.CtrlCmd | KeyCode.KeyW] }, @@ -1756,7 +1756,7 @@ export function registerTerminalActions() { title: terminalStrings.kill, f1: false, category, - precondition: ContextKeyExpr.or(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen), + precondition: ContextKeyExpr.or(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.isOpen), keybinding: { primary: KeyCode.Delete, mac: { @@ -1790,7 +1790,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.clear', "Clear"), original: 'Clear' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), keybinding: [{ primary: 0, mac: { primary: KeyMod.CtrlCmd | KeyCode.KeyK }, @@ -1841,7 +1841,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.openSettings', "Configure Terminal Settings"), original: 'Configure Terminal Settings' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor) { @@ -1856,7 +1856,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.setFixedDimensions', "Set Fixed Dimensions"), original: 'Set Fixed Dimensions' }, f1: true, category, - precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.isOpen) }); } async run(accessor: ServicesAccessor) { @@ -1871,7 +1871,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.sizeToContentWidth', "Toggle Size to Content Width"), original: 'Toggle Size to Content Width' }, f1: true, category, - precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.isOpen, TerminalContextKeys.focus), + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.isOpen, TerminalContextKeys.focus), keybinding: { primary: KeyMod.Alt | KeyCode.KeyZ, weight: KeybindingWeight.WorkbenchContrib @@ -1889,7 +1889,7 @@ export function registerTerminalActions() { title: terminalStrings.toggleSizeToContentWidth, f1: false, category, - precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.focus) + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.focus) }); } async run(accessor: ServicesAccessor) { @@ -1906,7 +1906,7 @@ export function registerTerminalActions() { f1: true, category, // TODO: Why is copy still showing up when text isn't selected? - precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), TerminalContextKeys.textSelected), + precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.textSelected), keybinding: [{ primary: KeyMod.CtrlCmd | KeyCode.KeyC, win: { primary: KeyMod.CtrlCmd | KeyCode.KeyC, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyC] }, @@ -1954,7 +1954,7 @@ export function registerTerminalActions() { title: { value: localize('workbench.action.terminal.pasteSelection', "Paste Selection into Active Terminal"), original: 'Paste Selection into Active Terminal' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile), + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), keybinding: [{ linux: { primary: KeyMod.Shift | KeyCode.Insert }, weight: KeybindingWeight.WorkbenchContrib, @@ -1976,7 +1976,7 @@ export function registerTerminalActions() { title: switchTerminalTitle, f1: false, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated, TerminalContextKeys.webExtensionContributedProfile) + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated) }); } async run(accessor: ServicesAccessor, item?: string) { @@ -2085,7 +2085,7 @@ export function refreshTerminalActions(detectedProfiles: ITerminalProfile[]) { title: { value: localize('workbench.action.terminal.newWithProfile', "Create New Terminal (With Profile)"), original: 'Create New Terminal (With Profile)' }, f1: true, category, - precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.webExtensionContributedProfile), + precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported), description: { description: 'workbench.action.terminal.newWithProfile', args: [{