@codingame/monaco-vscode-api 10.1.0 → 10.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/package.json +8 -15
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +1 -1
- package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/paneview.js +1 -1
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.js +1 -1
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +9 -9
- package/vscode/src/vs/base/common/date.js +61 -61
- package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
- package/vscode/src/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
- package/vscode/src/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/vscode/src/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
- package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +1 -1
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +4 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/vscode/src/vs/editor/common/config/editorConfigurationSchema.js +51 -51
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +71 -71
- package/vscode/src/vs/editor/common/model/editStack.js +1 -1
- package/vscode/src/vs/editor/common/standaloneStrings.js +32 -32
- package/vscode/src/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/vscode/src/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/vscode/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionCommands.js +28 -28
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/vscode/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +7 -7
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/vscode/src/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +27 -27
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +23 -23
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +14 -14
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/vscode/src/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +17 -17
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +5 -5
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +6 -6
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +16 -16
- package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +49 -49
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -2
- package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
- package/vscode/src/vs/platform/actions/common/menuService.js +2 -2
- package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/vscode/src/vs/platform/contextkey/common/contextkey.js +11 -11
- package/vscode/src/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/vscode/src/vs/platform/dialogs/common/dialogs.js +9 -9
- package/vscode/src/vs/platform/dnd/browser/dnd.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -2
- package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/vscode/src/vs/platform/list/browser/listService.js +27 -27
- package/vscode/src/vs/platform/markers/common/markers.js +3 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +8 -8
- package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/vscode/src/vs/platform/request/common/request.js +14 -14
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/vscode/src/vs/platform/theme/common/iconRegistry.js +5 -5
- package/vscode/src/vs/platform/theme/common/tokenClassificationRegistry.js +42 -42
- package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +5 -5
- package/vscode/src/vs/platform/workspace/common/workspace.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +129 -129
- package/vscode/src/vs/workbench/browser/actions/windowActions.js +25 -25
- package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +21 -21
- package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +4 -4
- package/vscode/src/vs/workbench/browser/editor.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbs.js +41 -41
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +16 -16
- package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +15 -15
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +17 -17
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +9 -9
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +13 -13
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +18 -18
- package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +4 -4
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +6 -6
- package/vscode/src/vs/workbench/browser/quickaccess.js +1 -1
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +217 -217
- package/vscode/src/vs/workbench/common/contextkeys.js +70 -70
- package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +1 -1
- package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +1 -1
- package/vscode/src/vs/workbench/common/views.js +4 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +131 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +17 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +7 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +8 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInvocationPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditingService.js +13 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImagePaste.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +6 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +4 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +5 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +9 -9
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +13 -13
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +10 -10
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +29 -29
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +65 -65
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +12 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +34 -34
- package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +57 -57
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +6 -6
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +173 -173
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +24 -24
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +5 -5
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +18 -18
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +14 -14
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +84 -84
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +33 -33
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +8 -8
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +7 -7
- package/vscode/src/vs/workbench/contrib/files/common/files.js +14 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +19 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +6 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +41 -41
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +29 -29
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +8 -8
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +28 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +15 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesIcons.js +12 -12
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +10 -10
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsLayout.js +50 -50
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.js +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +23 -23
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +5 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +10 -10
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +2 -2
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
- package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +5 -5
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.js +5 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +6 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +2 -2
- package/vscode/src/vs/workbench/services/activity/common/activity.js +4 -4
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +3 -3
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +5 -5
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.js +1 -1
- package/vscode/src/vs/workbench/services/language/common/languageService.js +28 -28
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +2 -2
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +7 -7
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +2 -2
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +9 -9
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +3 -3
- package/vscode/src/vs/workbench/services/themes/common/colorThemeData.js +8 -8
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +3 -3
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +7 -7
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +17 -17
- package/vscode/src/vs/base/common/processes.js +0 -25
- package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +0 -41
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.js +0 -345
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.js +0 -296
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +0 -761
- package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +0 -29
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +0 -22
- package/vscode/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +0 -48
- package/vscode/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +0 -94
- package/vscode/src/vs/platform/terminal/common/environmentVariable.js +0 -7
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +0 -196
- package/vscode/src/vs/platform/terminal/common/terminalEnvironment.js +0 -40
- package/vscode/src/vs/platform/terminal/common/terminalProfiles.js +0 -107
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +0 -67
- package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +0 -346
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +0 -167
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +0 -119
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +0 -1770
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +0 -40
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +0 -25
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.js +0 -72
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +0 -16
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +0 -2218
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +0 -628
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +0 -143
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +0 -61
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +0 -315
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +0 -121
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalUri.js +0 -39
- package/vscode/src/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +0 -36
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +0 -498
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +0 -123
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +0 -55
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +0 -571
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +0 -732
- package/vscode/src/vs/workbench/contrib/terminal/common/history.js +0 -378
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalClipboard.js +0 -80
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +0 -282
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +0 -36
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +0 -46
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +0 -303
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +0 -203
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.js +0 -97
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +0 -372
|
@@ -1,1770 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { BrowserFeatures } from '../../../../base/browser/canIUse.js';
|
|
3
|
-
import { Action } from '../../../../base/common/actions.js';
|
|
4
|
-
import { Codicon } from '../../../../base/common/codicons.js';
|
|
5
|
-
import { KeyChord } from '../../../../base/common/keyCodes.js';
|
|
6
|
-
import { Schemas } from '../../../../base/common/network.js';
|
|
7
|
-
import { isLinux, isWindows } from '../../../../base/common/platform.js';
|
|
8
|
-
import { isString, isObject } from '../../../../base/common/types.js';
|
|
9
|
-
import { URI } from '../../../../base/common/uri.js';
|
|
10
|
-
import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';
|
|
11
|
-
import { localize, localize2 } from '../../../../nls.js';
|
|
12
|
-
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from '../../../../platform/accessibility/common/accessibility.js';
|
|
13
|
-
import { registerAction2, MenuId, Action2 } from '../../../../platform/actions/common/actions.js';
|
|
14
|
-
import { ICommandService } from '../../../../platform/commands/common/commands.service.js';
|
|
15
|
-
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
|
|
16
|
-
import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
|
|
17
|
-
import { ILabelService } from '../../../../platform/label/common/label.service.js';
|
|
18
|
-
import { IListService } from '../../../../platform/list/browser/listService.service.js';
|
|
19
|
-
import '../../../../platform/notification/common/notification.js';
|
|
20
|
-
import { INotificationService } from '../../../../platform/notification/common/notification.service.js';
|
|
21
|
-
import { IOpenerService } from '../../../../platform/opener/common/opener.service.js';
|
|
22
|
-
import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.service.js';
|
|
23
|
-
import { TerminalLocation, TerminalExitReason } from '../../../../platform/terminal/common/terminal.js';
|
|
24
|
-
import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.service.js';
|
|
25
|
-
import { PICK_WORKSPACE_FOLDER_COMMAND_ID } from '../../../browser/actions/workspaceCommands.js';
|
|
26
|
-
import { CLOSE_EDITOR_COMMAND_ID } from '../../../browser/parts/editor/editorCommands.js';
|
|
27
|
-
import { ITerminalGroupService, ITerminalInstanceService, ITerminalService, ITerminalConfigurationService, ITerminalEditorService } from './terminal.service.js';
|
|
28
|
-
import { TerminalQuickAccessProvider } from './terminalQuickAccess.js';
|
|
29
|
-
import { TERMINAL_VIEW_ID } from '../common/terminal.js';
|
|
30
|
-
import { ITerminalProfileService, ITerminalProfileResolverService } from '../common/terminal.service.js';
|
|
31
|
-
import { TerminalContextKeys } from '../common/terminalContextKey.js';
|
|
32
|
-
import { createProfileSchemaEnums } from '../../../../platform/terminal/common/terminalProfiles.js';
|
|
33
|
-
import { terminalStrings } from '../common/terminalStrings.js';
|
|
34
|
-
import { IConfigurationResolverService } from '../../../services/configurationResolver/common/configurationResolver.service.js';
|
|
35
|
-
import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.service.js';
|
|
36
|
-
import { IHistoryService } from '../../../services/history/common/history.service.js';
|
|
37
|
-
import { IPreferencesService } from '../../../services/preferences/common/preferences.service.js';
|
|
38
|
-
import { IRemoteAgentService } from '../../../services/remote/common/remoteAgentService.service.js';
|
|
39
|
-
import { SIDE_GROUP } from '../../../services/editor/common/editorService.js';
|
|
40
|
-
import { isAbsolute } from '../../../../base/common/path.js';
|
|
41
|
-
import { AbstractVariableResolverService } from '../../../services/configurationResolver/common/variableResolver.js';
|
|
42
|
-
import { IThemeService } from '../../../../platform/theme/common/themeService.service.js';
|
|
43
|
-
import { getIconId, getColorClass, getUriClasses } from './terminalIcon.js';
|
|
44
|
-
import { getCommandHistory, clearShellFileHistory } from '../common/history.js';
|
|
45
|
-
import { IModelService } from '../../../../editor/common/services/model.js';
|
|
46
|
-
import { ILanguageService } from '../../../../editor/common/languages/language.js';
|
|
47
|
-
import { CancellationToken } from '../../../../base/common/cancellation.js';
|
|
48
|
-
import { dirname } from '../../../../base/common/resources.js';
|
|
49
|
-
import { getIconClasses } from '../../../../editor/common/services/getIconClasses.js';
|
|
50
|
-
import { FileKind } from '../../../../platform/files/common/files.js';
|
|
51
|
-
import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.service.js';
|
|
52
|
-
import { newTerminalIcon, killTerminalIcon } from './terminalIcons.js';
|
|
53
|
-
import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.service.js';
|
|
54
|
-
import { Iterable } from '../../../../base/common/iterator.js';
|
|
55
|
-
import { accessibleViewIsShown, accessibleViewCurrentProviderId, accessibleViewOnLastLine } from '../../accessibility/browser/accessibilityConfiguration.js';
|
|
56
|
-
import { isMouseEvent, isPointerEvent, isKeyboardEvent } from '../../../../base/browser/dom.js';
|
|
57
|
-
import { editorGroupToColumn } from '../../../services/editor/common/editorGroupColumn.js';
|
|
58
|
-
import { InstanceContext } from './terminalContextMenu.js';
|
|
59
|
-
import Severity$1 from '../../../../base/common/severity.js';
|
|
60
|
-
const switchTerminalActionViewItemSeparator = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500';
|
|
61
|
-
const switchTerminalShowTabsTitle = ( localize(8939, "Show Tabs"));
|
|
62
|
-
const category = terminalStrings.actionCategory;
|
|
63
|
-
const sharedWhenClause = (() => {
|
|
64
|
-
const terminalAvailable = ( (ContextKeyExpr.or(
|
|
65
|
-
TerminalContextKeys.processSupported,
|
|
66
|
-
TerminalContextKeys.terminalHasBeenCreated
|
|
67
|
-
)));
|
|
68
|
-
return {
|
|
69
|
-
terminalAvailable,
|
|
70
|
-
terminalAvailable_and_opened: ( (ContextKeyExpr.and(terminalAvailable, TerminalContextKeys.isOpen))),
|
|
71
|
-
terminalAvailable_and_editorActive: ( (ContextKeyExpr.and(terminalAvailable, TerminalContextKeys.terminalEditorActive))),
|
|
72
|
-
terminalAvailable_and_singularSelection: ( (ContextKeyExpr.and(terminalAvailable, TerminalContextKeys.tabsSingularSelection))),
|
|
73
|
-
focusInAny_and_normalBuffer: ( (ContextKeyExpr.and(
|
|
74
|
-
TerminalContextKeys.focusInAny,
|
|
75
|
-
(TerminalContextKeys.altBufferActive.negate())
|
|
76
|
-
)))
|
|
77
|
-
};
|
|
78
|
-
})();
|
|
79
|
-
async function getCwdForSplit(instance, folders, commandService, configService) {
|
|
80
|
-
switch (configService.config.splitCwd) {
|
|
81
|
-
case 'workspaceRoot':
|
|
82
|
-
if (folders !== undefined && commandService !== undefined) {
|
|
83
|
-
if (folders.length === 1) {
|
|
84
|
-
return folders[0].uri;
|
|
85
|
-
}
|
|
86
|
-
else if (folders.length > 1) {
|
|
87
|
-
const options = {
|
|
88
|
-
placeHolder: ( localize(8940, "Select current working directory for new terminal"))
|
|
89
|
-
};
|
|
90
|
-
const workspace = await commandService.executeCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID, [options]);
|
|
91
|
-
if (!workspace) {
|
|
92
|
-
return undefined;
|
|
93
|
-
}
|
|
94
|
-
return Promise.resolve(workspace.uri);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return '';
|
|
98
|
-
case 'initial':
|
|
99
|
-
return instance.getInitialCwd();
|
|
100
|
-
case 'inherited':
|
|
101
|
-
return instance.getCwd();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
const terminalSendSequenceCommand = async (accessor, args) => {
|
|
105
|
-
const instance = accessor.get(ITerminalService).activeInstance;
|
|
106
|
-
if (instance) {
|
|
107
|
-
const text = isObject(args) && 'text' in args ? toOptionalString(args.text) : undefined;
|
|
108
|
-
if (!text) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
const configurationResolverService = accessor.get(IConfigurationResolverService);
|
|
112
|
-
const workspaceContextService = accessor.get(IWorkspaceContextService);
|
|
113
|
-
const historyService = accessor.get(IHistoryService);
|
|
114
|
-
const activeWorkspaceRootUri = historyService.getLastActiveWorkspaceRoot(instance.isRemote ? Schemas.vscodeRemote : Schemas.file);
|
|
115
|
-
const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) ?? undefined : undefined;
|
|
116
|
-
const resolvedText = await configurationResolverService.resolveAsync(lastActiveWorkspaceRoot, text);
|
|
117
|
-
instance.sendText(resolvedText, false);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
let TerminalLaunchHelpAction = class TerminalLaunchHelpAction extends Action {
|
|
121
|
-
constructor(_openerService) {
|
|
122
|
-
super('workbench.action.terminal.launchHelp', ( localize(8941, "Open Help")));
|
|
123
|
-
this._openerService = _openerService;
|
|
124
|
-
}
|
|
125
|
-
async run() {
|
|
126
|
-
this._openerService.open('https://aka.ms/vscode-troubleshoot-terminal-launch');
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
TerminalLaunchHelpAction = ( (__decorate([
|
|
130
|
-
( (__param(0, IOpenerService)))
|
|
131
|
-
], TerminalLaunchHelpAction)));
|
|
132
|
-
function registerTerminalAction(options) {
|
|
133
|
-
options.f1 = options.f1 ?? true;
|
|
134
|
-
options.category = options.category ?? category;
|
|
135
|
-
options.precondition = options.precondition ?? TerminalContextKeys.processSupported;
|
|
136
|
-
const runFunc = options.run;
|
|
137
|
-
const strictOptions = options;
|
|
138
|
-
delete strictOptions['run'];
|
|
139
|
-
return registerAction2(class extends Action2 {
|
|
140
|
-
constructor() {
|
|
141
|
-
super(strictOptions);
|
|
142
|
-
}
|
|
143
|
-
run(accessor, args, args2) {
|
|
144
|
-
return runFunc(getTerminalServices(accessor), accessor, args, args2);
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
function parseActionArgs(args) {
|
|
149
|
-
if (Array.isArray(args)) {
|
|
150
|
-
if (args.every(e => e instanceof InstanceContext)) {
|
|
151
|
-
return args;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
else if (args instanceof InstanceContext) {
|
|
155
|
-
return [args];
|
|
156
|
-
}
|
|
157
|
-
return undefined;
|
|
158
|
-
}
|
|
159
|
-
function registerContextualInstanceAction(options) {
|
|
160
|
-
const originalRun = options.run;
|
|
161
|
-
return registerTerminalAction({
|
|
162
|
-
...options,
|
|
163
|
-
run: async (c, accessor, focusedInstanceArgs, allInstanceArgs) => {
|
|
164
|
-
let instances = getSelectedInstances2(accessor, allInstanceArgs);
|
|
165
|
-
if (!instances) {
|
|
166
|
-
const activeInstance = (options.activeInstanceType === 'view'
|
|
167
|
-
? c.groupService
|
|
168
|
-
: options.activeInstanceType === 'editor' ?
|
|
169
|
-
c.editorService
|
|
170
|
-
: c.service).activeInstance;
|
|
171
|
-
if (!activeInstance) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
instances = [activeInstance];
|
|
175
|
-
}
|
|
176
|
-
const results = [];
|
|
177
|
-
for (const instance of instances) {
|
|
178
|
-
results.push(originalRun(instance, c, accessor, focusedInstanceArgs));
|
|
179
|
-
}
|
|
180
|
-
await Promise.all(results);
|
|
181
|
-
if (options.runAfter) {
|
|
182
|
-
options.runAfter(instances, c, accessor, focusedInstanceArgs);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
function registerActiveInstanceAction(options) {
|
|
188
|
-
const originalRun = options.run;
|
|
189
|
-
return registerTerminalAction({
|
|
190
|
-
...options,
|
|
191
|
-
run: (c, accessor, args) => {
|
|
192
|
-
const activeInstance = c.service.activeInstance;
|
|
193
|
-
if (activeInstance) {
|
|
194
|
-
return originalRun(activeInstance, c, accessor, args);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
function registerActiveXtermAction(options) {
|
|
200
|
-
const originalRun = options.run;
|
|
201
|
-
return registerTerminalAction({
|
|
202
|
-
...options,
|
|
203
|
-
run: (c, accessor, args) => {
|
|
204
|
-
const activeDetached = Iterable.find(c.service.detachedInstances, d => d.xterm.isFocused);
|
|
205
|
-
if (activeDetached) {
|
|
206
|
-
return originalRun(activeDetached.xterm, accessor, activeDetached, args);
|
|
207
|
-
}
|
|
208
|
-
const activeInstance = c.service.activeInstance;
|
|
209
|
-
if (activeInstance?.xterm) {
|
|
210
|
-
return originalRun(activeInstance.xterm, accessor, activeInstance, args);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
function getTerminalServices(accessor) {
|
|
216
|
-
return {
|
|
217
|
-
service: accessor.get(ITerminalService),
|
|
218
|
-
configService: accessor.get(ITerminalConfigurationService),
|
|
219
|
-
groupService: accessor.get(ITerminalGroupService),
|
|
220
|
-
instanceService: accessor.get(ITerminalInstanceService),
|
|
221
|
-
editorService: accessor.get(ITerminalEditorService),
|
|
222
|
-
profileService: accessor.get(ITerminalProfileService),
|
|
223
|
-
profileResolverService: accessor.get(ITerminalProfileResolverService)
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
function registerTerminalActions() {
|
|
227
|
-
registerTerminalAction({
|
|
228
|
-
id: "workbench.action.terminal.newInActiveWorkspace" ,
|
|
229
|
-
title: ( localize2(8942, 'Create New Terminal (In Active Workspace)')),
|
|
230
|
-
run: async (c) => {
|
|
231
|
-
if (c.service.isProcessSupportRegistered) {
|
|
232
|
-
const instance = await c.service.createTerminal({ location: c.service.defaultLocation });
|
|
233
|
-
if (!instance) {
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
c.service.setActiveInstance(instance);
|
|
237
|
-
}
|
|
238
|
-
await c.groupService.showPanel(true);
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
refreshTerminalActions([]);
|
|
242
|
-
registerTerminalAction({
|
|
243
|
-
id: "workbench.action.createTerminalEditor" ,
|
|
244
|
-
title: ( localize2(8943, 'Create New Terminal in Editor Area')),
|
|
245
|
-
run: async (c, _, args) => {
|
|
246
|
-
const options = (isObject(args) && 'location' in args) ? args : { location: TerminalLocation.Editor };
|
|
247
|
-
const instance = await c.service.createTerminal(options);
|
|
248
|
-
await instance.focusWhenReady();
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
registerTerminalAction({
|
|
252
|
-
id: "workbench.action.createTerminalEditorSameGroup" ,
|
|
253
|
-
title: ( localize2(8943, 'Create New Terminal in Editor Area')),
|
|
254
|
-
f1: false,
|
|
255
|
-
run: async (c, accessor, args) => {
|
|
256
|
-
const editorGroupsService = accessor.get(IEditorGroupsService);
|
|
257
|
-
const instance = await c.service.createTerminal({
|
|
258
|
-
location: { viewColumn: editorGroupToColumn(editorGroupsService, editorGroupsService.activeGroup) }
|
|
259
|
-
});
|
|
260
|
-
await instance.focusWhenReady();
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
registerTerminalAction({
|
|
264
|
-
id: "workbench.action.createTerminalEditorSide" ,
|
|
265
|
-
title: ( localize2(8944, 'Create New Terminal in Editor Area to the Side')),
|
|
266
|
-
run: async (c) => {
|
|
267
|
-
const instance = await c.service.createTerminal({
|
|
268
|
-
location: { viewColumn: SIDE_GROUP }
|
|
269
|
-
});
|
|
270
|
-
await instance.focusWhenReady();
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
registerContextualInstanceAction({
|
|
274
|
-
id: "workbench.action.terminal.moveToEditor" ,
|
|
275
|
-
title: terminalStrings.moveToEditor,
|
|
276
|
-
precondition: sharedWhenClause.terminalAvailable_and_opened,
|
|
277
|
-
activeInstanceType: 'view',
|
|
278
|
-
run: (instance, c) => c.service.moveToEditor(instance),
|
|
279
|
-
runAfter: (instances) => instances.at(-1)?.focus()
|
|
280
|
-
});
|
|
281
|
-
registerContextualInstanceAction({
|
|
282
|
-
id: "workbench.action.terminal.moveIntoNewWindow" ,
|
|
283
|
-
title: terminalStrings.moveIntoNewWindow,
|
|
284
|
-
precondition: sharedWhenClause.terminalAvailable_and_opened,
|
|
285
|
-
run: (instance, c) => c.service.moveIntoNewEditor(instance),
|
|
286
|
-
runAfter: (instances) => instances.at(-1)?.focus()
|
|
287
|
-
});
|
|
288
|
-
registerTerminalAction({
|
|
289
|
-
id: "workbench.action.terminal.moveToTerminalPanel" ,
|
|
290
|
-
title: terminalStrings.moveToTerminalPanel,
|
|
291
|
-
precondition: sharedWhenClause.terminalAvailable_and_editorActive,
|
|
292
|
-
run: (c, _, args) => {
|
|
293
|
-
const source = toOptionalUri(args) ?? c.editorService.activeInstance;
|
|
294
|
-
if (source) {
|
|
295
|
-
c.service.moveToTerminalView(source);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
registerTerminalAction({
|
|
300
|
-
id: "workbench.action.terminal.focusPreviousPane" ,
|
|
301
|
-
title: ( localize2(8945, 'Focus Previous Terminal in Terminal Group')),
|
|
302
|
-
keybinding: {
|
|
303
|
-
primary: 512 | 15 ,
|
|
304
|
-
secondary: [512 | 16 ],
|
|
305
|
-
mac: {
|
|
306
|
-
primary: 512 | 2048 | 15 ,
|
|
307
|
-
secondary: [512 | 2048 | 16 ]
|
|
308
|
-
},
|
|
309
|
-
when: TerminalContextKeys.focus,
|
|
310
|
-
weight: 200
|
|
311
|
-
},
|
|
312
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
313
|
-
run: async (c) => {
|
|
314
|
-
c.groupService.activeGroup?.focusPreviousPane();
|
|
315
|
-
await c.groupService.showPanel(true);
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
registerTerminalAction({
|
|
319
|
-
id: "workbench.action.terminal.focusNextPane" ,
|
|
320
|
-
title: ( localize2(8946, 'Focus Next Terminal in Terminal Group')),
|
|
321
|
-
keybinding: {
|
|
322
|
-
primary: 512 | 17 ,
|
|
323
|
-
secondary: [512 | 18 ],
|
|
324
|
-
mac: {
|
|
325
|
-
primary: 512 | 2048 | 17 ,
|
|
326
|
-
secondary: [512 | 2048 | 18 ]
|
|
327
|
-
},
|
|
328
|
-
when: TerminalContextKeys.focus,
|
|
329
|
-
weight: 200
|
|
330
|
-
},
|
|
331
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
332
|
-
run: async (c) => {
|
|
333
|
-
c.groupService.activeGroup?.focusNextPane();
|
|
334
|
-
await c.groupService.showPanel(true);
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
registerActiveInstanceAction({
|
|
338
|
-
id: "workbench.action.terminal.runRecentCommand" ,
|
|
339
|
-
title: ( localize2(8947, 'Run Recent Command...')),
|
|
340
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
341
|
-
keybinding: [
|
|
342
|
-
{
|
|
343
|
-
primary: 2048 | 48 ,
|
|
344
|
-
when: ( (ContextKeyExpr.and(
|
|
345
|
-
CONTEXT_ACCESSIBILITY_MODE_ENABLED,
|
|
346
|
-
(ContextKeyExpr.or(TerminalContextKeys.focus, (ContextKeyExpr.and(
|
|
347
|
-
accessibleViewIsShown,
|
|
348
|
-
(accessibleViewCurrentProviderId.isEqualTo("terminal" ))
|
|
349
|
-
))))
|
|
350
|
-
))),
|
|
351
|
-
weight: 200
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
primary: 2048 | 512 | 48 ,
|
|
355
|
-
mac: { primary: 256 | 512 | 48 },
|
|
356
|
-
when: ( (ContextKeyExpr.and(
|
|
357
|
-
TerminalContextKeys.focus,
|
|
358
|
-
(CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())
|
|
359
|
-
))),
|
|
360
|
-
weight: 200
|
|
361
|
-
}
|
|
362
|
-
],
|
|
363
|
-
run: async (activeInstance, c) => {
|
|
364
|
-
await activeInstance.runRecent('command');
|
|
365
|
-
if (activeInstance?.target === TerminalLocation.Editor) {
|
|
366
|
-
await c.editorService.revealActiveEditor();
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
369
|
-
await c.groupService.showPanel(false);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
registerActiveInstanceAction({
|
|
374
|
-
id: "workbench.action.terminal.copyLastCommand" ,
|
|
375
|
-
title: ( localize2(8948, "Copy Last Command")),
|
|
376
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
377
|
-
run: async (instance, c, accessor) => {
|
|
378
|
-
const clipboardService = accessor.get(IClipboardService);
|
|
379
|
-
const commands = instance.capabilities.get(2 )?.commands;
|
|
380
|
-
if (!commands || commands.length === 0) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
const command = commands[commands.length - 1];
|
|
384
|
-
if (!command.command) {
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
await clipboardService.writeText(command.command);
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
registerActiveInstanceAction({
|
|
391
|
-
id: "workbench.action.terminal.copyLastCommandOutput" ,
|
|
392
|
-
title: ( localize2(8949, "Copy Last Command Output")),
|
|
393
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
394
|
-
run: async (instance, c, accessor) => {
|
|
395
|
-
const clipboardService = accessor.get(IClipboardService);
|
|
396
|
-
const commands = instance.capabilities.get(2 )?.commands;
|
|
397
|
-
if (!commands || commands.length === 0) {
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
|
-
const command = commands[commands.length - 1];
|
|
401
|
-
if (!command?.hasOutput()) {
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
const output = command.getOutput();
|
|
405
|
-
if (isString(output)) {
|
|
406
|
-
await clipboardService.writeText(output);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
registerActiveInstanceAction({
|
|
411
|
-
id: "workbench.action.terminal.copyLastCommandAndLastCommandOutput" ,
|
|
412
|
-
title: ( localize2(8950, "Copy Last Command and Output")),
|
|
413
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
414
|
-
run: async (instance, c, accessor) => {
|
|
415
|
-
const clipboardService = accessor.get(IClipboardService);
|
|
416
|
-
const commands = instance.capabilities.get(2 )?.commands;
|
|
417
|
-
if (!commands || commands.length === 0) {
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
const command = commands[commands.length - 1];
|
|
421
|
-
if (!command?.hasOutput()) {
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
const output = command.getOutput();
|
|
425
|
-
if (isString(output)) {
|
|
426
|
-
await clipboardService.writeText(`${command.command !== '' ? command.command + '\n' : ''}${output}`);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
registerActiveInstanceAction({
|
|
431
|
-
id: "workbench.action.terminal.goToRecentDirectory" ,
|
|
432
|
-
title: ( localize2(8951, 'Go to Recent Directory...')),
|
|
433
|
-
metadata: {
|
|
434
|
-
description: ( localize2(8952, 'Goes to a recent folder')),
|
|
435
|
-
},
|
|
436
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
437
|
-
keybinding: {
|
|
438
|
-
primary: 2048 | 37 ,
|
|
439
|
-
when: TerminalContextKeys.focus,
|
|
440
|
-
weight: 200
|
|
441
|
-
},
|
|
442
|
-
run: async (activeInstance, c) => {
|
|
443
|
-
await activeInstance.runRecent('cwd');
|
|
444
|
-
if (activeInstance?.target === TerminalLocation.Editor) {
|
|
445
|
-
await c.editorService.revealActiveEditor();
|
|
446
|
-
}
|
|
447
|
-
else {
|
|
448
|
-
await c.groupService.showPanel(false);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
});
|
|
452
|
-
registerTerminalAction({
|
|
453
|
-
id: "workbench.action.terminal.resizePaneLeft" ,
|
|
454
|
-
title: ( localize2(8953, 'Resize Terminal Left')),
|
|
455
|
-
keybinding: {
|
|
456
|
-
linux: { primary: 2048 | 1024 | 15 },
|
|
457
|
-
mac: { primary: 2048 | 256 | 15 },
|
|
458
|
-
when: TerminalContextKeys.focus,
|
|
459
|
-
weight: 200
|
|
460
|
-
},
|
|
461
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
462
|
-
run: (c) => c.groupService.activeGroup?.resizePane(0 )
|
|
463
|
-
});
|
|
464
|
-
registerTerminalAction({
|
|
465
|
-
id: "workbench.action.terminal.resizePaneRight" ,
|
|
466
|
-
title: ( localize2(8954, 'Resize Terminal Right')),
|
|
467
|
-
keybinding: {
|
|
468
|
-
linux: { primary: 2048 | 1024 | 17 },
|
|
469
|
-
mac: { primary: 2048 | 256 | 17 },
|
|
470
|
-
when: TerminalContextKeys.focus,
|
|
471
|
-
weight: 200
|
|
472
|
-
},
|
|
473
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
474
|
-
run: (c) => c.groupService.activeGroup?.resizePane(1 )
|
|
475
|
-
});
|
|
476
|
-
registerTerminalAction({
|
|
477
|
-
id: "workbench.action.terminal.resizePaneUp" ,
|
|
478
|
-
title: ( localize2(8955, 'Resize Terminal Up')),
|
|
479
|
-
keybinding: {
|
|
480
|
-
mac: { primary: 2048 | 256 | 16 },
|
|
481
|
-
when: TerminalContextKeys.focus,
|
|
482
|
-
weight: 200
|
|
483
|
-
},
|
|
484
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
485
|
-
run: (c) => c.groupService.activeGroup?.resizePane(2 )
|
|
486
|
-
});
|
|
487
|
-
registerTerminalAction({
|
|
488
|
-
id: "workbench.action.terminal.resizePaneDown" ,
|
|
489
|
-
title: ( localize2(8956, 'Resize Terminal Down')),
|
|
490
|
-
keybinding: {
|
|
491
|
-
mac: { primary: 2048 | 256 | 18 },
|
|
492
|
-
when: TerminalContextKeys.focus,
|
|
493
|
-
weight: 200
|
|
494
|
-
},
|
|
495
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
496
|
-
run: (c) => c.groupService.activeGroup?.resizePane(3 )
|
|
497
|
-
});
|
|
498
|
-
registerTerminalAction({
|
|
499
|
-
id: "workbench.action.terminal.focus" ,
|
|
500
|
-
title: terminalStrings.focus,
|
|
501
|
-
keybinding: {
|
|
502
|
-
when: ( (ContextKeyExpr.and(
|
|
503
|
-
CONTEXT_ACCESSIBILITY_MODE_ENABLED,
|
|
504
|
-
accessibleViewOnLastLine,
|
|
505
|
-
(accessibleViewCurrentProviderId.isEqualTo("terminal" ))
|
|
506
|
-
))),
|
|
507
|
-
primary: 2048 | 18 ,
|
|
508
|
-
weight: 200
|
|
509
|
-
},
|
|
510
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
511
|
-
run: async (c) => {
|
|
512
|
-
const instance = c.service.activeInstance || (await c.service.createTerminal({ location: TerminalLocation.Panel }));
|
|
513
|
-
if (!instance) {
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
c.service.setActiveInstance(instance);
|
|
517
|
-
focusActiveTerminal(instance, c);
|
|
518
|
-
}
|
|
519
|
-
});
|
|
520
|
-
registerTerminalAction({
|
|
521
|
-
id: "workbench.action.terminal.focusTabs" ,
|
|
522
|
-
title: ( localize2(8957, 'Focus Terminal Tabs View')),
|
|
523
|
-
keybinding: {
|
|
524
|
-
primary: 2048 | 1024 | 93 ,
|
|
525
|
-
weight: 200 ,
|
|
526
|
-
when: ( (ContextKeyExpr.or(TerminalContextKeys.tabsFocus, TerminalContextKeys.focus))),
|
|
527
|
-
},
|
|
528
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
529
|
-
run: (c) => c.groupService.focusTabs()
|
|
530
|
-
});
|
|
531
|
-
registerTerminalAction({
|
|
532
|
-
id: "workbench.action.terminal.focusNext" ,
|
|
533
|
-
title: ( localize2(8958, 'Focus Next Terminal Group')),
|
|
534
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
535
|
-
keybinding: {
|
|
536
|
-
primary: 2048 | 12 ,
|
|
537
|
-
mac: {
|
|
538
|
-
primary: 2048 | 1024 | 94
|
|
539
|
-
},
|
|
540
|
-
when: ( (ContextKeyExpr.and(
|
|
541
|
-
TerminalContextKeys.focus,
|
|
542
|
-
(TerminalContextKeys.editorFocus.negate())
|
|
543
|
-
))),
|
|
544
|
-
weight: 200
|
|
545
|
-
},
|
|
546
|
-
run: async (c) => {
|
|
547
|
-
c.groupService.setActiveGroupToNext();
|
|
548
|
-
await c.groupService.showPanel(true);
|
|
549
|
-
}
|
|
550
|
-
});
|
|
551
|
-
registerTerminalAction({
|
|
552
|
-
id: "workbench.action.terminal.focusPrevious" ,
|
|
553
|
-
title: ( localize2(8959, 'Focus Previous Terminal Group')),
|
|
554
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
555
|
-
keybinding: {
|
|
556
|
-
primary: 2048 | 11 ,
|
|
557
|
-
mac: {
|
|
558
|
-
primary: 2048 | 1024 | 92
|
|
559
|
-
},
|
|
560
|
-
when: ( (ContextKeyExpr.and(
|
|
561
|
-
TerminalContextKeys.focus,
|
|
562
|
-
(TerminalContextKeys.editorFocus.negate())
|
|
563
|
-
))),
|
|
564
|
-
weight: 200
|
|
565
|
-
},
|
|
566
|
-
run: async (c) => {
|
|
567
|
-
c.groupService.setActiveGroupToPrevious();
|
|
568
|
-
await c.groupService.showPanel(true);
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
registerTerminalAction({
|
|
572
|
-
id: "workbench.action.terminal.runSelectedText" ,
|
|
573
|
-
title: ( localize2(8960, 'Run Selected Text In Active Terminal')),
|
|
574
|
-
run: async (c, accessor) => {
|
|
575
|
-
const codeEditorService = accessor.get(ICodeEditorService);
|
|
576
|
-
const editor = codeEditorService.getActiveCodeEditor();
|
|
577
|
-
if (!editor || !editor.hasModel()) {
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
const instance = await c.service.getActiveOrCreateInstance({ acceptsInput: true });
|
|
581
|
-
const selection = editor.getSelection();
|
|
582
|
-
let text;
|
|
583
|
-
if (selection.isEmpty()) {
|
|
584
|
-
text = editor.getModel().getLineContent(selection.selectionStartLineNumber).trim();
|
|
585
|
-
}
|
|
586
|
-
else {
|
|
587
|
-
const endOfLinePreference = isWindows ? 1 : 2 ;
|
|
588
|
-
text = editor.getModel().getValueInRange(selection, endOfLinePreference);
|
|
589
|
-
}
|
|
590
|
-
instance.sendText(text, true, true);
|
|
591
|
-
await c.service.revealActiveTerminal(true);
|
|
592
|
-
}
|
|
593
|
-
});
|
|
594
|
-
registerTerminalAction({
|
|
595
|
-
id: "workbench.action.terminal.runActiveFile" ,
|
|
596
|
-
title: ( localize2(8961, 'Run Active File In Active Terminal')),
|
|
597
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
598
|
-
run: async (c, accessor) => {
|
|
599
|
-
const codeEditorService = accessor.get(ICodeEditorService);
|
|
600
|
-
const notificationService = accessor.get(INotificationService);
|
|
601
|
-
const workbenchEnvironmentService = accessor.get(IWorkbenchEnvironmentService);
|
|
602
|
-
const editor = codeEditorService.getActiveCodeEditor();
|
|
603
|
-
if (!editor || !editor.hasModel()) {
|
|
604
|
-
return;
|
|
605
|
-
}
|
|
606
|
-
const instance = await c.service.getActiveOrCreateInstance({ acceptsInput: true });
|
|
607
|
-
const isRemote = instance ? instance.isRemote : (workbenchEnvironmentService.remoteAuthority ? true : false);
|
|
608
|
-
const uri = editor.getModel().uri;
|
|
609
|
-
if ((!isRemote && uri.scheme !== Schemas.file && uri.scheme !== Schemas.vscodeUserData) || (isRemote && uri.scheme !== Schemas.vscodeRemote)) {
|
|
610
|
-
notificationService.warn(( localize(8962, 'Only files on disk can be run in the terminal')));
|
|
611
|
-
return;
|
|
612
|
-
}
|
|
613
|
-
await instance.sendPath(uri, true);
|
|
614
|
-
return c.groupService.showPanel();
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
registerActiveXtermAction({
|
|
618
|
-
id: "workbench.action.terminal.scrollDown" ,
|
|
619
|
-
title: ( localize2(8963, 'Scroll Down (Line)')),
|
|
620
|
-
keybinding: {
|
|
621
|
-
primary: 2048 | 512 | 12 ,
|
|
622
|
-
linux: { primary: 2048 | 1024 | 18 },
|
|
623
|
-
when: sharedWhenClause.focusInAny_and_normalBuffer,
|
|
624
|
-
weight: 200
|
|
625
|
-
},
|
|
626
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
627
|
-
run: (xterm) => xterm.scrollDownLine()
|
|
628
|
-
});
|
|
629
|
-
registerActiveXtermAction({
|
|
630
|
-
id: "workbench.action.terminal.scrollDownPage" ,
|
|
631
|
-
title: ( localize2(8964, 'Scroll Down (Page)')),
|
|
632
|
-
keybinding: {
|
|
633
|
-
primary: 1024 | 12 ,
|
|
634
|
-
mac: { primary: 12 },
|
|
635
|
-
when: sharedWhenClause.focusInAny_and_normalBuffer,
|
|
636
|
-
weight: 200
|
|
637
|
-
},
|
|
638
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
639
|
-
run: (xterm) => xterm.scrollDownPage()
|
|
640
|
-
});
|
|
641
|
-
registerActiveXtermAction({
|
|
642
|
-
id: "workbench.action.terminal.scrollToBottom" ,
|
|
643
|
-
title: ( localize2(8965, 'Scroll to Bottom')),
|
|
644
|
-
keybinding: {
|
|
645
|
-
primary: 2048 | 13 ,
|
|
646
|
-
linux: { primary: 1024 | 13 },
|
|
647
|
-
when: sharedWhenClause.focusInAny_and_normalBuffer,
|
|
648
|
-
weight: 200
|
|
649
|
-
},
|
|
650
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
651
|
-
run: (xterm) => xterm.scrollToBottom()
|
|
652
|
-
});
|
|
653
|
-
registerActiveXtermAction({
|
|
654
|
-
id: "workbench.action.terminal.scrollUp" ,
|
|
655
|
-
title: ( localize2(8966, 'Scroll Up (Line)')),
|
|
656
|
-
keybinding: {
|
|
657
|
-
primary: 2048 | 512 | 11 ,
|
|
658
|
-
linux: { primary: 2048 | 1024 | 16 },
|
|
659
|
-
when: sharedWhenClause.focusInAny_and_normalBuffer,
|
|
660
|
-
weight: 200
|
|
661
|
-
},
|
|
662
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
663
|
-
run: (xterm) => xterm.scrollUpLine()
|
|
664
|
-
});
|
|
665
|
-
registerActiveXtermAction({
|
|
666
|
-
id: "workbench.action.terminal.scrollUpPage" ,
|
|
667
|
-
title: ( localize2(8967, 'Scroll Up (Page)')),
|
|
668
|
-
f1: true,
|
|
669
|
-
category,
|
|
670
|
-
keybinding: {
|
|
671
|
-
primary: 1024 | 11 ,
|
|
672
|
-
mac: { primary: 11 },
|
|
673
|
-
when: sharedWhenClause.focusInAny_and_normalBuffer,
|
|
674
|
-
weight: 200
|
|
675
|
-
},
|
|
676
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
677
|
-
run: (xterm) => xterm.scrollUpPage()
|
|
678
|
-
});
|
|
679
|
-
registerActiveXtermAction({
|
|
680
|
-
id: "workbench.action.terminal.scrollToTop" ,
|
|
681
|
-
title: ( localize2(8968, 'Scroll to Top')),
|
|
682
|
-
keybinding: {
|
|
683
|
-
primary: 2048 | 14 ,
|
|
684
|
-
linux: { primary: 1024 | 14 },
|
|
685
|
-
when: sharedWhenClause.focusInAny_and_normalBuffer,
|
|
686
|
-
weight: 200
|
|
687
|
-
},
|
|
688
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
689
|
-
run: (xterm) => xterm.scrollToTop()
|
|
690
|
-
});
|
|
691
|
-
registerActiveXtermAction({
|
|
692
|
-
id: "workbench.action.terminal.clearSelection" ,
|
|
693
|
-
title: ( localize2(8969, 'Clear Selection')),
|
|
694
|
-
keybinding: {
|
|
695
|
-
primary: 9 ,
|
|
696
|
-
when: ( (ContextKeyExpr.and(
|
|
697
|
-
TerminalContextKeys.focusInAny,
|
|
698
|
-
TerminalContextKeys.textSelected,
|
|
699
|
-
TerminalContextKeys.notFindVisible
|
|
700
|
-
))),
|
|
701
|
-
weight: 200
|
|
702
|
-
},
|
|
703
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
704
|
-
run: (xterm) => {
|
|
705
|
-
if (xterm.hasSelection()) {
|
|
706
|
-
xterm.clearSelection();
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
});
|
|
710
|
-
registerTerminalAction({
|
|
711
|
-
id: "workbench.action.terminal.changeIcon" ,
|
|
712
|
-
title: terminalStrings.changeIcon,
|
|
713
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
714
|
-
run: (c, _, args) => getResourceOrActiveInstance(c, args)?.changeIcon()
|
|
715
|
-
});
|
|
716
|
-
registerTerminalAction({
|
|
717
|
-
id: "workbench.action.terminal.changeIconActiveTab" ,
|
|
718
|
-
title: terminalStrings.changeIcon,
|
|
719
|
-
f1: false,
|
|
720
|
-
precondition: sharedWhenClause.terminalAvailable_and_singularSelection,
|
|
721
|
-
run: async (c, accessor, args) => {
|
|
722
|
-
let icon;
|
|
723
|
-
if (c.groupService.lastAccessedMenu === 'inline-tab') {
|
|
724
|
-
getResourceOrActiveInstance(c, args)?.changeIcon();
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
for (const terminal of getSelectedInstances(accessor) ?? []) {
|
|
728
|
-
icon = await terminal.changeIcon(icon);
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
});
|
|
732
|
-
registerTerminalAction({
|
|
733
|
-
id: "workbench.action.terminal.changeColor" ,
|
|
734
|
-
title: terminalStrings.changeColor,
|
|
735
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
736
|
-
run: (c, _, args) => getResourceOrActiveInstance(c, args)?.changeColor()
|
|
737
|
-
});
|
|
738
|
-
registerTerminalAction({
|
|
739
|
-
id: "workbench.action.terminal.changeColorActiveTab" ,
|
|
740
|
-
title: terminalStrings.changeColor,
|
|
741
|
-
f1: false,
|
|
742
|
-
precondition: sharedWhenClause.terminalAvailable_and_singularSelection,
|
|
743
|
-
run: async (c, accessor, args) => {
|
|
744
|
-
let color;
|
|
745
|
-
let i = 0;
|
|
746
|
-
if (c.groupService.lastAccessedMenu === 'inline-tab') {
|
|
747
|
-
getResourceOrActiveInstance(c, args)?.changeColor();
|
|
748
|
-
return;
|
|
749
|
-
}
|
|
750
|
-
for (const terminal of getSelectedInstances(accessor) ?? []) {
|
|
751
|
-
const skipQuickPick = i !== 0;
|
|
752
|
-
color = await terminal.changeColor(color, skipQuickPick);
|
|
753
|
-
i++;
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
});
|
|
757
|
-
registerTerminalAction({
|
|
758
|
-
id: "workbench.action.terminal.rename" ,
|
|
759
|
-
title: terminalStrings.rename,
|
|
760
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
761
|
-
run: (c, accessor, args) => renameWithQuickPick(c, accessor, args)
|
|
762
|
-
});
|
|
763
|
-
registerTerminalAction({
|
|
764
|
-
id: "workbench.action.terminal.renameActiveTab" ,
|
|
765
|
-
title: terminalStrings.rename,
|
|
766
|
-
f1: false,
|
|
767
|
-
keybinding: {
|
|
768
|
-
primary: 60 ,
|
|
769
|
-
mac: {
|
|
770
|
-
primary: 3
|
|
771
|
-
},
|
|
772
|
-
when: ( (ContextKeyExpr.and(TerminalContextKeys.tabsFocus))),
|
|
773
|
-
weight: 200
|
|
774
|
-
},
|
|
775
|
-
precondition: sharedWhenClause.terminalAvailable_and_singularSelection,
|
|
776
|
-
run: async (c, accessor) => {
|
|
777
|
-
const terminalGroupService = accessor.get(ITerminalGroupService);
|
|
778
|
-
const notificationService = accessor.get(INotificationService);
|
|
779
|
-
const instances = getSelectedInstances(accessor);
|
|
780
|
-
const firstInstance = instances?.[0];
|
|
781
|
-
if (!firstInstance) {
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
if (terminalGroupService.lastAccessedMenu === 'inline-tab') {
|
|
785
|
-
return renameWithQuickPick(c, accessor, firstInstance);
|
|
786
|
-
}
|
|
787
|
-
c.service.setEditingTerminal(firstInstance);
|
|
788
|
-
c.service.setEditable(firstInstance, {
|
|
789
|
-
validationMessage: value => validateTerminalName(value),
|
|
790
|
-
onFinish: async (value, success) => {
|
|
791
|
-
c.service.setEditable(firstInstance, null);
|
|
792
|
-
c.service.setEditingTerminal(undefined);
|
|
793
|
-
if (success) {
|
|
794
|
-
const promises = [];
|
|
795
|
-
for (const instance of instances) {
|
|
796
|
-
promises.push((async () => {
|
|
797
|
-
await instance.rename(value);
|
|
798
|
-
})());
|
|
799
|
-
}
|
|
800
|
-
try {
|
|
801
|
-
await Promise.all(promises);
|
|
802
|
-
}
|
|
803
|
-
catch (e) {
|
|
804
|
-
notificationService.error(e);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
});
|
|
811
|
-
registerActiveInstanceAction({
|
|
812
|
-
id: "workbench.action.terminal.detachSession" ,
|
|
813
|
-
title: ( localize2(8970, 'Detach Session')),
|
|
814
|
-
run: (activeInstance) => activeInstance.detachProcessAndDispose(TerminalExitReason.User)
|
|
815
|
-
});
|
|
816
|
-
registerTerminalAction({
|
|
817
|
-
id: "workbench.action.terminal.attachToSession" ,
|
|
818
|
-
title: ( localize2(8971, 'Attach to Session')),
|
|
819
|
-
run: async (c, accessor) => {
|
|
820
|
-
const quickInputService = accessor.get(IQuickInputService);
|
|
821
|
-
const labelService = accessor.get(ILabelService);
|
|
822
|
-
const remoteAgentService = accessor.get(IRemoteAgentService);
|
|
823
|
-
const notificationService = accessor.get(INotificationService);
|
|
824
|
-
const remoteAuthority = remoteAgentService.getConnection()?.remoteAuthority ?? undefined;
|
|
825
|
-
const backend = await accessor.get(ITerminalInstanceService).getBackend(remoteAuthority);
|
|
826
|
-
if (!backend) {
|
|
827
|
-
throw ( (new Error(`No backend registered for remote authority '${remoteAuthority}'`)));
|
|
828
|
-
}
|
|
829
|
-
const terms = await backend.listProcesses();
|
|
830
|
-
backend.reduceConnectionGraceTime();
|
|
831
|
-
const unattachedTerms = terms.filter(term => !c.service.isAttachedToTerminal(term));
|
|
832
|
-
const items = ( (unattachedTerms.map(term => {
|
|
833
|
-
const cwdLabel = labelService.getUriLabel(URI.file(term.cwd));
|
|
834
|
-
return {
|
|
835
|
-
label: term.title,
|
|
836
|
-
detail: term.workspaceName ? `${term.workspaceName} \u2E31 ${cwdLabel}` : cwdLabel,
|
|
837
|
-
description: term.pid ? String(term.pid) : '',
|
|
838
|
-
term
|
|
839
|
-
};
|
|
840
|
-
})));
|
|
841
|
-
if (items.length === 0) {
|
|
842
|
-
notificationService.info(( localize(8972, 'There are no unattached terminals to attach to')));
|
|
843
|
-
return;
|
|
844
|
-
}
|
|
845
|
-
const selected = await quickInputService.pick(items, { canPickMany: false });
|
|
846
|
-
if (selected) {
|
|
847
|
-
const instance = await c.service.createTerminal({
|
|
848
|
-
config: { attachPersistentProcess: selected.term }
|
|
849
|
-
});
|
|
850
|
-
c.service.setActiveInstance(instance);
|
|
851
|
-
await focusActiveTerminal(instance, c);
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
});
|
|
855
|
-
registerTerminalAction({
|
|
856
|
-
id: "workbench.action.quickOpenTerm" ,
|
|
857
|
-
title: ( localize2(8973, 'Switch Active Terminal')),
|
|
858
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
859
|
-
run: (c, accessor) => accessor.get(IQuickInputService).quickAccess.show(TerminalQuickAccessProvider.PREFIX)
|
|
860
|
-
});
|
|
861
|
-
registerActiveInstanceAction({
|
|
862
|
-
id: "workbench.action.terminal.scrollToPreviousCommand" ,
|
|
863
|
-
title: terminalStrings.scrollToPreviousCommand,
|
|
864
|
-
keybinding: {
|
|
865
|
-
primary: 2048 | 16 ,
|
|
866
|
-
when: ( (ContextKeyExpr.and(
|
|
867
|
-
TerminalContextKeys.focus,
|
|
868
|
-
(CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())
|
|
869
|
-
))),
|
|
870
|
-
weight: 200
|
|
871
|
-
},
|
|
872
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
873
|
-
icon: Codicon.arrowUp,
|
|
874
|
-
menu: [
|
|
875
|
-
{
|
|
876
|
-
id: MenuId.ViewTitle,
|
|
877
|
-
group: 'navigation',
|
|
878
|
-
order: 4,
|
|
879
|
-
when: ( (ContextKeyExpr.equals('view', TERMINAL_VIEW_ID))),
|
|
880
|
-
isHiddenByDefault: true
|
|
881
|
-
}
|
|
882
|
-
],
|
|
883
|
-
run: (activeInstance) => activeInstance.xterm?.markTracker.scrollToPreviousMark(undefined, undefined, ( (activeInstance.capabilities.has(2 ))))
|
|
884
|
-
});
|
|
885
|
-
registerActiveInstanceAction({
|
|
886
|
-
id: "workbench.action.terminal.scrollToNextCommand" ,
|
|
887
|
-
title: terminalStrings.scrollToNextCommand,
|
|
888
|
-
keybinding: {
|
|
889
|
-
primary: 2048 | 18 ,
|
|
890
|
-
when: ( (ContextKeyExpr.and(
|
|
891
|
-
TerminalContextKeys.focus,
|
|
892
|
-
(CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())
|
|
893
|
-
))),
|
|
894
|
-
weight: 200
|
|
895
|
-
},
|
|
896
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
897
|
-
icon: Codicon.arrowDown,
|
|
898
|
-
menu: [
|
|
899
|
-
{
|
|
900
|
-
id: MenuId.ViewTitle,
|
|
901
|
-
group: 'navigation',
|
|
902
|
-
order: 4,
|
|
903
|
-
when: ( (ContextKeyExpr.equals('view', TERMINAL_VIEW_ID))),
|
|
904
|
-
isHiddenByDefault: true
|
|
905
|
-
}
|
|
906
|
-
],
|
|
907
|
-
run: (activeInstance) => {
|
|
908
|
-
activeInstance.xterm?.markTracker.scrollToNextMark();
|
|
909
|
-
activeInstance.focus();
|
|
910
|
-
}
|
|
911
|
-
});
|
|
912
|
-
registerActiveInstanceAction({
|
|
913
|
-
id: "workbench.action.terminal.selectToPreviousCommand" ,
|
|
914
|
-
title: ( localize2(8974, 'Select To Previous Command')),
|
|
915
|
-
keybinding: {
|
|
916
|
-
primary: 2048 | 1024 | 16 ,
|
|
917
|
-
when: TerminalContextKeys.focus,
|
|
918
|
-
weight: 200
|
|
919
|
-
},
|
|
920
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
921
|
-
run: (activeInstance) => {
|
|
922
|
-
activeInstance.xterm?.markTracker.selectToPreviousMark();
|
|
923
|
-
activeInstance.focus();
|
|
924
|
-
}
|
|
925
|
-
});
|
|
926
|
-
registerActiveInstanceAction({
|
|
927
|
-
id: "workbench.action.terminal.selectToNextCommand" ,
|
|
928
|
-
title: ( localize2(8975, 'Select To Next Command')),
|
|
929
|
-
keybinding: {
|
|
930
|
-
primary: 2048 | 1024 | 18 ,
|
|
931
|
-
when: TerminalContextKeys.focus,
|
|
932
|
-
weight: 200
|
|
933
|
-
},
|
|
934
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
935
|
-
run: (activeInstance) => {
|
|
936
|
-
activeInstance.xterm?.markTracker.selectToNextMark();
|
|
937
|
-
activeInstance.focus();
|
|
938
|
-
}
|
|
939
|
-
});
|
|
940
|
-
registerActiveXtermAction({
|
|
941
|
-
id: "workbench.action.terminal.selectToPreviousLine" ,
|
|
942
|
-
title: ( localize2(8976, 'Select To Previous Line')),
|
|
943
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
944
|
-
run: async (xterm, _, instance) => {
|
|
945
|
-
xterm.markTracker.selectToPreviousLine();
|
|
946
|
-
(instance || xterm).focus();
|
|
947
|
-
}
|
|
948
|
-
});
|
|
949
|
-
registerActiveXtermAction({
|
|
950
|
-
id: "workbench.action.terminal.selectToNextLine" ,
|
|
951
|
-
title: ( localize2(8977, 'Select To Next Line')),
|
|
952
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
953
|
-
run: async (xterm, _, instance) => {
|
|
954
|
-
xterm.markTracker.selectToNextLine();
|
|
955
|
-
(instance || xterm).focus();
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
registerTerminalAction({
|
|
959
|
-
id: "workbench.action.terminal.sendSequence" ,
|
|
960
|
-
title: terminalStrings.sendSequence,
|
|
961
|
-
f1: false,
|
|
962
|
-
metadata: {
|
|
963
|
-
description: terminalStrings.sendSequence.value,
|
|
964
|
-
args: [{
|
|
965
|
-
name: 'args',
|
|
966
|
-
schema: {
|
|
967
|
-
type: 'object',
|
|
968
|
-
required: ['text'],
|
|
969
|
-
properties: {
|
|
970
|
-
text: {
|
|
971
|
-
description: ( localize(8978, "The sequence of text to send to the terminal")),
|
|
972
|
-
type: 'string'
|
|
973
|
-
}
|
|
974
|
-
},
|
|
975
|
-
}
|
|
976
|
-
}]
|
|
977
|
-
},
|
|
978
|
-
run: (c, accessor, args) => terminalSendSequenceCommand(accessor, args)
|
|
979
|
-
});
|
|
980
|
-
registerTerminalAction({
|
|
981
|
-
id: "workbench.action.terminal.newWithCwd" ,
|
|
982
|
-
title: terminalStrings.newWithCwd,
|
|
983
|
-
metadata: {
|
|
984
|
-
description: terminalStrings.newWithCwd.value,
|
|
985
|
-
args: [{
|
|
986
|
-
name: 'args',
|
|
987
|
-
schema: {
|
|
988
|
-
type: 'object',
|
|
989
|
-
required: ['cwd'],
|
|
990
|
-
properties: {
|
|
991
|
-
cwd: {
|
|
992
|
-
description: ( localize(8979, "The directory to start the terminal at")),
|
|
993
|
-
type: 'string'
|
|
994
|
-
}
|
|
995
|
-
},
|
|
996
|
-
}
|
|
997
|
-
}]
|
|
998
|
-
},
|
|
999
|
-
run: async (c, _, args) => {
|
|
1000
|
-
const cwd = isObject(args) && 'cwd' in args ? toOptionalString(args.cwd) : undefined;
|
|
1001
|
-
const instance = await c.service.createTerminal({ cwd });
|
|
1002
|
-
if (!instance) {
|
|
1003
|
-
return;
|
|
1004
|
-
}
|
|
1005
|
-
c.service.setActiveInstance(instance);
|
|
1006
|
-
await focusActiveTerminal(instance, c);
|
|
1007
|
-
}
|
|
1008
|
-
});
|
|
1009
|
-
registerActiveInstanceAction({
|
|
1010
|
-
id: "workbench.action.terminal.renameWithArg" ,
|
|
1011
|
-
title: terminalStrings.renameWithArgs,
|
|
1012
|
-
metadata: {
|
|
1013
|
-
description: terminalStrings.renameWithArgs.value,
|
|
1014
|
-
args: [{
|
|
1015
|
-
name: 'args',
|
|
1016
|
-
schema: {
|
|
1017
|
-
type: 'object',
|
|
1018
|
-
required: ['name'],
|
|
1019
|
-
properties: {
|
|
1020
|
-
name: {
|
|
1021
|
-
description: ( localize(8980, "The new name for the terminal")),
|
|
1022
|
-
type: 'string',
|
|
1023
|
-
minLength: 1
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
}]
|
|
1028
|
-
},
|
|
1029
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1030
|
-
run: async (activeInstance, c, accessor, args) => {
|
|
1031
|
-
const notificationService = accessor.get(INotificationService);
|
|
1032
|
-
const name = isObject(args) && 'name' in args ? toOptionalString(args.name) : undefined;
|
|
1033
|
-
if (!name) {
|
|
1034
|
-
notificationService.warn(( localize(8981, "No name argument provided")));
|
|
1035
|
-
return;
|
|
1036
|
-
}
|
|
1037
|
-
activeInstance.rename(name);
|
|
1038
|
-
}
|
|
1039
|
-
});
|
|
1040
|
-
registerActiveInstanceAction({
|
|
1041
|
-
id: "workbench.action.terminal.relaunch" ,
|
|
1042
|
-
title: ( localize2(8982, 'Relaunch Active Terminal')),
|
|
1043
|
-
run: (activeInstance) => activeInstance.relaunch()
|
|
1044
|
-
});
|
|
1045
|
-
registerTerminalAction({
|
|
1046
|
-
id: "workbench.action.terminal.split" ,
|
|
1047
|
-
title: terminalStrings.split,
|
|
1048
|
-
precondition: ( (ContextKeyExpr.or(
|
|
1049
|
-
TerminalContextKeys.processSupported,
|
|
1050
|
-
TerminalContextKeys.webExtensionContributedProfile
|
|
1051
|
-
))),
|
|
1052
|
-
keybinding: {
|
|
1053
|
-
primary: 2048 | 1024 | 26 ,
|
|
1054
|
-
weight: 200 ,
|
|
1055
|
-
mac: {
|
|
1056
|
-
primary: 2048 | 93 ,
|
|
1057
|
-
secondary: [256 | 1024 | 26 ]
|
|
1058
|
-
},
|
|
1059
|
-
when: TerminalContextKeys.focus
|
|
1060
|
-
},
|
|
1061
|
-
icon: Codicon.splitHorizontal,
|
|
1062
|
-
run: async (c, accessor, args) => {
|
|
1063
|
-
const optionsOrProfile = isObject(args) ? args : undefined;
|
|
1064
|
-
const commandService = accessor.get(ICommandService);
|
|
1065
|
-
const workspaceContextService = accessor.get(IWorkspaceContextService);
|
|
1066
|
-
const options = convertOptionsOrProfileToOptions(optionsOrProfile);
|
|
1067
|
-
const activeInstance = (await c.service.getInstanceHost(options?.location)).activeInstance;
|
|
1068
|
-
if (!activeInstance) {
|
|
1069
|
-
return;
|
|
1070
|
-
}
|
|
1071
|
-
const cwd = await getCwdForSplit(activeInstance, workspaceContextService.getWorkspace().folders, commandService, c.configService);
|
|
1072
|
-
if (cwd === undefined) {
|
|
1073
|
-
return;
|
|
1074
|
-
}
|
|
1075
|
-
const instance = await c.service.createTerminal({ location: { parentTerminal: activeInstance }, config: options?.config, cwd });
|
|
1076
|
-
await focusActiveTerminal(instance, c);
|
|
1077
|
-
}
|
|
1078
|
-
});
|
|
1079
|
-
registerTerminalAction({
|
|
1080
|
-
id: "workbench.action.terminal.splitActiveTab" ,
|
|
1081
|
-
title: terminalStrings.split,
|
|
1082
|
-
f1: false,
|
|
1083
|
-
keybinding: {
|
|
1084
|
-
primary: 2048 | 1024 | 26 ,
|
|
1085
|
-
mac: {
|
|
1086
|
-
primary: 2048 | 93 ,
|
|
1087
|
-
secondary: [256 | 1024 | 26 ]
|
|
1088
|
-
},
|
|
1089
|
-
weight: 200 ,
|
|
1090
|
-
when: TerminalContextKeys.tabsFocus
|
|
1091
|
-
},
|
|
1092
|
-
run: async (c, accessor) => {
|
|
1093
|
-
const instances = getSelectedInstances(accessor);
|
|
1094
|
-
if (instances) {
|
|
1095
|
-
const promises = [];
|
|
1096
|
-
for (const t of instances) {
|
|
1097
|
-
promises.push((async () => {
|
|
1098
|
-
await c.service.createTerminal({ location: { parentTerminal: t } });
|
|
1099
|
-
await c.groupService.showPanel(true);
|
|
1100
|
-
})());
|
|
1101
|
-
}
|
|
1102
|
-
await Promise.all(promises);
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
});
|
|
1106
|
-
registerContextualInstanceAction({
|
|
1107
|
-
id: "workbench.action.terminal.unsplit" ,
|
|
1108
|
-
title: terminalStrings.unsplit,
|
|
1109
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1110
|
-
run: async (instance, c) => {
|
|
1111
|
-
const group = c.groupService.getGroupForInstance(instance);
|
|
1112
|
-
if (group && group?.terminalInstances.length > 1) {
|
|
1113
|
-
c.groupService.unsplitInstance(instance);
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
});
|
|
1117
|
-
registerTerminalAction({
|
|
1118
|
-
id: "workbench.action.terminal.joinActiveTab" ,
|
|
1119
|
-
title: ( localize2(8983, 'Join Terminals')),
|
|
1120
|
-
precondition: ( (ContextKeyExpr.and(
|
|
1121
|
-
sharedWhenClause.terminalAvailable,
|
|
1122
|
-
(TerminalContextKeys.tabsSingularSelection.toNegated())
|
|
1123
|
-
))),
|
|
1124
|
-
run: async (c, accessor) => {
|
|
1125
|
-
const instances = getSelectedInstances(accessor);
|
|
1126
|
-
if (instances && instances.length > 1) {
|
|
1127
|
-
c.groupService.joinInstances(instances);
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
});
|
|
1131
|
-
registerTerminalAction({
|
|
1132
|
-
id: "workbench.action.terminal.join" ,
|
|
1133
|
-
title: ( localize2(8984, 'Join Terminals...')),
|
|
1134
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1135
|
-
run: async (c, accessor) => {
|
|
1136
|
-
const themeService = accessor.get(IThemeService);
|
|
1137
|
-
const notificationService = accessor.get(INotificationService);
|
|
1138
|
-
const quickInputService = accessor.get(IQuickInputService);
|
|
1139
|
-
const picks = [];
|
|
1140
|
-
if (c.groupService.instances.length <= 1) {
|
|
1141
|
-
notificationService.warn(( localize(8985, 'Insufficient terminals for the join action')));
|
|
1142
|
-
return;
|
|
1143
|
-
}
|
|
1144
|
-
const otherInstances = c.groupService.instances.filter(i => i.instanceId !== c.groupService.activeInstance?.instanceId);
|
|
1145
|
-
for (const terminal of otherInstances) {
|
|
1146
|
-
const group = c.groupService.getGroupForInstance(terminal);
|
|
1147
|
-
if (group?.terminalInstances.length === 1) {
|
|
1148
|
-
const iconId = getIconId(accessor, terminal);
|
|
1149
|
-
const label = `$(${iconId}): ${terminal.title}`;
|
|
1150
|
-
const iconClasses = [];
|
|
1151
|
-
const colorClass = getColorClass(terminal);
|
|
1152
|
-
if (colorClass) {
|
|
1153
|
-
iconClasses.push(colorClass);
|
|
1154
|
-
}
|
|
1155
|
-
const uriClasses = getUriClasses(terminal, themeService.getColorTheme().type);
|
|
1156
|
-
if (uriClasses) {
|
|
1157
|
-
iconClasses.push(...uriClasses);
|
|
1158
|
-
}
|
|
1159
|
-
picks.push({
|
|
1160
|
-
terminal,
|
|
1161
|
-
label,
|
|
1162
|
-
iconClasses
|
|
1163
|
-
});
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
if (picks.length === 0) {
|
|
1167
|
-
notificationService.warn(( localize(8986, 'All terminals are joined already')));
|
|
1168
|
-
return;
|
|
1169
|
-
}
|
|
1170
|
-
const result = await quickInputService.pick(picks, {});
|
|
1171
|
-
if (result) {
|
|
1172
|
-
c.groupService.joinInstances([result.terminal, c.groupService.activeInstance]);
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
});
|
|
1176
|
-
registerActiveInstanceAction({
|
|
1177
|
-
id: "workbench.action.terminal.splitInActiveWorkspace" ,
|
|
1178
|
-
title: ( localize2(8987, 'Split Terminal (In Active Workspace)')),
|
|
1179
|
-
run: async (instance, c) => {
|
|
1180
|
-
const newInstance = await c.service.createTerminal({ location: { parentTerminal: instance } });
|
|
1181
|
-
if (newInstance?.target !== TerminalLocation.Editor) {
|
|
1182
|
-
await c.groupService.showPanel(true);
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
});
|
|
1186
|
-
registerActiveXtermAction({
|
|
1187
|
-
id: "workbench.action.terminal.selectAll" ,
|
|
1188
|
-
title: ( localize2(8988, 'Select All')),
|
|
1189
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1190
|
-
keybinding: [{
|
|
1191
|
-
primary: 0,
|
|
1192
|
-
mac: { primary: 2048 | 31 },
|
|
1193
|
-
weight: 200 ,
|
|
1194
|
-
when: TerminalContextKeys.focusInAny
|
|
1195
|
-
}],
|
|
1196
|
-
run: (xterm) => xterm.selectAll()
|
|
1197
|
-
});
|
|
1198
|
-
registerTerminalAction({
|
|
1199
|
-
id: "workbench.action.terminal.new" ,
|
|
1200
|
-
title: ( localize2(8989, 'Create New Terminal')),
|
|
1201
|
-
precondition: ( (ContextKeyExpr.or(
|
|
1202
|
-
TerminalContextKeys.processSupported,
|
|
1203
|
-
TerminalContextKeys.webExtensionContributedProfile
|
|
1204
|
-
))),
|
|
1205
|
-
icon: newTerminalIcon,
|
|
1206
|
-
keybinding: {
|
|
1207
|
-
primary: 2048 | 1024 | 91 ,
|
|
1208
|
-
mac: { primary: 256 | 1024 | 91 },
|
|
1209
|
-
weight: 200
|
|
1210
|
-
},
|
|
1211
|
-
run: async (c, accessor, args) => {
|
|
1212
|
-
let eventOrOptions = isObject(args) ? args : undefined;
|
|
1213
|
-
const workspaceContextService = accessor.get(IWorkspaceContextService);
|
|
1214
|
-
const commandService = accessor.get(ICommandService);
|
|
1215
|
-
const folders = workspaceContextService.getWorkspace().folders;
|
|
1216
|
-
if (eventOrOptions && isMouseEvent(eventOrOptions) && (eventOrOptions.altKey || eventOrOptions.ctrlKey)) {
|
|
1217
|
-
await c.service.createTerminal({ location: { splitActiveTerminal: true } });
|
|
1218
|
-
return;
|
|
1219
|
-
}
|
|
1220
|
-
if (c.service.isProcessSupportRegistered) {
|
|
1221
|
-
eventOrOptions = !eventOrOptions || isMouseEvent(eventOrOptions) ? {} : eventOrOptions;
|
|
1222
|
-
let instance;
|
|
1223
|
-
if (folders.length <= 1) {
|
|
1224
|
-
instance = await c.service.createTerminal(eventOrOptions);
|
|
1225
|
-
}
|
|
1226
|
-
else {
|
|
1227
|
-
const cwd = (await pickTerminalCwd(accessor))?.cwd;
|
|
1228
|
-
if (!cwd) {
|
|
1229
|
-
return;
|
|
1230
|
-
}
|
|
1231
|
-
eventOrOptions.cwd = cwd;
|
|
1232
|
-
instance = await c.service.createTerminal(eventOrOptions);
|
|
1233
|
-
}
|
|
1234
|
-
c.service.setActiveInstance(instance);
|
|
1235
|
-
await focusActiveTerminal(instance, c);
|
|
1236
|
-
}
|
|
1237
|
-
else {
|
|
1238
|
-
if (c.profileService.contributedProfiles.length > 0) {
|
|
1239
|
-
commandService.executeCommand("workbench.action.terminal.newWithProfile" );
|
|
1240
|
-
}
|
|
1241
|
-
else {
|
|
1242
|
-
commandService.executeCommand("workbench.action.terminal.toggleTerminal" );
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
});
|
|
1247
|
-
async function killInstance(c, instance) {
|
|
1248
|
-
if (!instance) {
|
|
1249
|
-
return;
|
|
1250
|
-
}
|
|
1251
|
-
await c.service.safeDisposeTerminal(instance);
|
|
1252
|
-
if (c.groupService.instances.length > 0) {
|
|
1253
|
-
await c.groupService.showPanel(true);
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
registerTerminalAction({
|
|
1257
|
-
id: "workbench.action.terminal.kill" ,
|
|
1258
|
-
title: ( localize2(8990, 'Kill the Active Terminal Instance')),
|
|
1259
|
-
precondition: ( (ContextKeyExpr.or(sharedWhenClause.terminalAvailable, TerminalContextKeys.isOpen))),
|
|
1260
|
-
icon: killTerminalIcon,
|
|
1261
|
-
run: async (c) => killInstance(c, c.groupService.activeInstance)
|
|
1262
|
-
});
|
|
1263
|
-
registerTerminalAction({
|
|
1264
|
-
id: "workbench.action.terminal.killViewOrEditor" ,
|
|
1265
|
-
title: terminalStrings.kill,
|
|
1266
|
-
f1: false,
|
|
1267
|
-
precondition: ( (ContextKeyExpr.or(sharedWhenClause.terminalAvailable, TerminalContextKeys.isOpen))),
|
|
1268
|
-
run: async (c) => killInstance(c, c.service.activeInstance)
|
|
1269
|
-
});
|
|
1270
|
-
registerTerminalAction({
|
|
1271
|
-
id: "workbench.action.terminal.killAll" ,
|
|
1272
|
-
title: ( localize2(8991, 'Kill All Terminals')),
|
|
1273
|
-
precondition: ( (ContextKeyExpr.or(sharedWhenClause.terminalAvailable, TerminalContextKeys.isOpen))),
|
|
1274
|
-
icon: Codicon.trash,
|
|
1275
|
-
run: async (c) => {
|
|
1276
|
-
const disposePromises = [];
|
|
1277
|
-
for (const instance of c.service.instances) {
|
|
1278
|
-
disposePromises.push(c.service.safeDisposeTerminal(instance));
|
|
1279
|
-
}
|
|
1280
|
-
await Promise.all(disposePromises);
|
|
1281
|
-
}
|
|
1282
|
-
});
|
|
1283
|
-
registerTerminalAction({
|
|
1284
|
-
id: "workbench.action.terminal.killEditor" ,
|
|
1285
|
-
title: ( localize2(8992, 'Kill the Active Terminal in Editor Area')),
|
|
1286
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1287
|
-
keybinding: {
|
|
1288
|
-
primary: 2048 | 53 ,
|
|
1289
|
-
win: { primary: 2048 | 62 , secondary: [2048 | 53 ] },
|
|
1290
|
-
weight: 200 ,
|
|
1291
|
-
when: ( (ContextKeyExpr.and(TerminalContextKeys.focus, TerminalContextKeys.editorFocus)))
|
|
1292
|
-
},
|
|
1293
|
-
run: (c, accessor) => accessor.get(ICommandService).executeCommand(CLOSE_EDITOR_COMMAND_ID)
|
|
1294
|
-
});
|
|
1295
|
-
registerTerminalAction({
|
|
1296
|
-
id: "workbench.action.terminal.killActiveTab" ,
|
|
1297
|
-
title: terminalStrings.kill,
|
|
1298
|
-
f1: false,
|
|
1299
|
-
precondition: ( (ContextKeyExpr.or(sharedWhenClause.terminalAvailable, TerminalContextKeys.isOpen))),
|
|
1300
|
-
keybinding: {
|
|
1301
|
-
primary: 20 ,
|
|
1302
|
-
mac: {
|
|
1303
|
-
primary: 2048 | 1 ,
|
|
1304
|
-
secondary: [20 ]
|
|
1305
|
-
},
|
|
1306
|
-
weight: 200 ,
|
|
1307
|
-
when: TerminalContextKeys.tabsFocus
|
|
1308
|
-
},
|
|
1309
|
-
run: async (c, accessor) => {
|
|
1310
|
-
const disposePromises = [];
|
|
1311
|
-
for (const terminal of getSelectedInstances(accessor) ?? []) {
|
|
1312
|
-
disposePromises.push(c.service.safeDisposeTerminal(terminal));
|
|
1313
|
-
}
|
|
1314
|
-
await Promise.all(disposePromises);
|
|
1315
|
-
c.groupService.focusTabs();
|
|
1316
|
-
}
|
|
1317
|
-
});
|
|
1318
|
-
registerTerminalAction({
|
|
1319
|
-
id: "workbench.action.terminal.focusHover" ,
|
|
1320
|
-
title: terminalStrings.focusHover,
|
|
1321
|
-
precondition: ( (ContextKeyExpr.or(sharedWhenClause.terminalAvailable, TerminalContextKeys.isOpen))),
|
|
1322
|
-
keybinding: {
|
|
1323
|
-
primary: KeyChord(2048 | 41 , 2048 | 39 ),
|
|
1324
|
-
weight: 200 ,
|
|
1325
|
-
when: ( (ContextKeyExpr.or(TerminalContextKeys.tabsFocus, TerminalContextKeys.focus)))
|
|
1326
|
-
},
|
|
1327
|
-
run: (c) => c.groupService.focusHover()
|
|
1328
|
-
});
|
|
1329
|
-
registerActiveInstanceAction({
|
|
1330
|
-
id: "workbench.action.terminal.clear" ,
|
|
1331
|
-
title: ( localize2(8993, 'Clear')),
|
|
1332
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1333
|
-
keybinding: [{
|
|
1334
|
-
primary: 0,
|
|
1335
|
-
mac: { primary: 2048 | 41 },
|
|
1336
|
-
weight: 200 + 1,
|
|
1337
|
-
when: ( (ContextKeyExpr.or( (ContextKeyExpr.and(
|
|
1338
|
-
TerminalContextKeys.focus,
|
|
1339
|
-
(CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())
|
|
1340
|
-
)), (ContextKeyExpr.and(
|
|
1341
|
-
CONTEXT_ACCESSIBILITY_MODE_ENABLED,
|
|
1342
|
-
accessibleViewIsShown,
|
|
1343
|
-
(accessibleViewCurrentProviderId.isEqualTo("terminal" ))
|
|
1344
|
-
))))),
|
|
1345
|
-
}],
|
|
1346
|
-
run: (activeInstance) => activeInstance.clearBuffer()
|
|
1347
|
-
});
|
|
1348
|
-
registerTerminalAction({
|
|
1349
|
-
id: "workbench.action.terminal.selectDefaultShell" ,
|
|
1350
|
-
title: ( localize2(8994, 'Select Default Profile')),
|
|
1351
|
-
run: (c) => c.service.showProfileQuickPick('setDefault')
|
|
1352
|
-
});
|
|
1353
|
-
registerTerminalAction({
|
|
1354
|
-
id: "workbench.action.terminal.openSettings" ,
|
|
1355
|
-
title: ( localize2(8995, 'Configure Terminal Settings')),
|
|
1356
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1357
|
-
run: (c, accessor) => accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@feature:terminal' })
|
|
1358
|
-
});
|
|
1359
|
-
registerActiveInstanceAction({
|
|
1360
|
-
id: "workbench.action.terminal.setDimensions" ,
|
|
1361
|
-
title: ( localize2(8996, 'Set Fixed Dimensions')),
|
|
1362
|
-
precondition: sharedWhenClause.terminalAvailable_and_opened,
|
|
1363
|
-
run: (activeInstance) => activeInstance.setFixedDimensions()
|
|
1364
|
-
});
|
|
1365
|
-
registerContextualInstanceAction({
|
|
1366
|
-
id: "workbench.action.terminal.sizeToContentWidth" ,
|
|
1367
|
-
title: terminalStrings.toggleSizeToContentWidth,
|
|
1368
|
-
precondition: sharedWhenClause.terminalAvailable_and_opened,
|
|
1369
|
-
keybinding: {
|
|
1370
|
-
primary: 512 | 56 ,
|
|
1371
|
-
weight: 200 ,
|
|
1372
|
-
when: TerminalContextKeys.focus
|
|
1373
|
-
},
|
|
1374
|
-
run: (instance) => instance.toggleSizeToContentWidth()
|
|
1375
|
-
});
|
|
1376
|
-
registerTerminalAction({
|
|
1377
|
-
id: "workbench.action.terminal.clearPreviousSessionHistory" ,
|
|
1378
|
-
title: ( localize2(8997, 'Clear Previous Session History')),
|
|
1379
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1380
|
-
run: async (c, accessor) => {
|
|
1381
|
-
getCommandHistory(accessor).clear();
|
|
1382
|
-
clearShellFileHistory();
|
|
1383
|
-
}
|
|
1384
|
-
});
|
|
1385
|
-
if (BrowserFeatures.clipboard.writeText) {
|
|
1386
|
-
registerActiveXtermAction({
|
|
1387
|
-
id: "workbench.action.terminal.copySelection" ,
|
|
1388
|
-
title: ( localize2(8998, 'Copy Selection')),
|
|
1389
|
-
precondition: ( (ContextKeyExpr.or(
|
|
1390
|
-
TerminalContextKeys.textSelectedInFocused,
|
|
1391
|
-
(ContextKeyExpr.and(sharedWhenClause.terminalAvailable, TerminalContextKeys.textSelected))
|
|
1392
|
-
))),
|
|
1393
|
-
keybinding: [{
|
|
1394
|
-
primary: 2048 | 1024 | 33 ,
|
|
1395
|
-
mac: { primary: 2048 | 33 },
|
|
1396
|
-
weight: 200 ,
|
|
1397
|
-
when: ( (ContextKeyExpr.or(
|
|
1398
|
-
(ContextKeyExpr.and(TerminalContextKeys.textSelected, TerminalContextKeys.focus)),
|
|
1399
|
-
TerminalContextKeys.textSelectedInFocused
|
|
1400
|
-
)))
|
|
1401
|
-
}],
|
|
1402
|
-
run: (activeInstance) => activeInstance.copySelection()
|
|
1403
|
-
});
|
|
1404
|
-
registerActiveXtermAction({
|
|
1405
|
-
id: "workbench.action.terminal.copyAndClearSelection" ,
|
|
1406
|
-
title: ( localize2(8999, 'Copy and Clear Selection')),
|
|
1407
|
-
precondition: ( (ContextKeyExpr.or(
|
|
1408
|
-
TerminalContextKeys.textSelectedInFocused,
|
|
1409
|
-
(ContextKeyExpr.and(sharedWhenClause.terminalAvailable, TerminalContextKeys.textSelected))
|
|
1410
|
-
))),
|
|
1411
|
-
keybinding: [{
|
|
1412
|
-
win: { primary: 2048 | 33 },
|
|
1413
|
-
weight: 200 ,
|
|
1414
|
-
when: ( (ContextKeyExpr.or(
|
|
1415
|
-
(ContextKeyExpr.and(TerminalContextKeys.textSelected, TerminalContextKeys.focus)),
|
|
1416
|
-
TerminalContextKeys.textSelectedInFocused
|
|
1417
|
-
)))
|
|
1418
|
-
}],
|
|
1419
|
-
run: async (xterm) => {
|
|
1420
|
-
await xterm.copySelection();
|
|
1421
|
-
xterm.clearSelection();
|
|
1422
|
-
}
|
|
1423
|
-
});
|
|
1424
|
-
registerActiveXtermAction({
|
|
1425
|
-
id: "workbench.action.terminal.copySelectionAsHtml" ,
|
|
1426
|
-
title: ( localize2(9000, 'Copy Selection as HTML')),
|
|
1427
|
-
f1: true,
|
|
1428
|
-
category,
|
|
1429
|
-
precondition: ( (ContextKeyExpr.or(
|
|
1430
|
-
TerminalContextKeys.textSelectedInFocused,
|
|
1431
|
-
(ContextKeyExpr.and(sharedWhenClause.terminalAvailable, TerminalContextKeys.textSelected))
|
|
1432
|
-
))),
|
|
1433
|
-
run: (xterm) => xterm.copySelection(true)
|
|
1434
|
-
});
|
|
1435
|
-
}
|
|
1436
|
-
if (BrowserFeatures.clipboard.readText) {
|
|
1437
|
-
registerActiveInstanceAction({
|
|
1438
|
-
id: "workbench.action.terminal.paste" ,
|
|
1439
|
-
title: ( localize2(9001, 'Paste into Active Terminal')),
|
|
1440
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1441
|
-
keybinding: [{
|
|
1442
|
-
primary: 2048 | 52 ,
|
|
1443
|
-
win: { primary: 2048 | 52 , secondary: [2048 | 1024 | 52 ] },
|
|
1444
|
-
linux: { primary: 2048 | 1024 | 52 },
|
|
1445
|
-
weight: 200 ,
|
|
1446
|
-
when: TerminalContextKeys.focus
|
|
1447
|
-
}],
|
|
1448
|
-
run: (activeInstance) => activeInstance.paste()
|
|
1449
|
-
});
|
|
1450
|
-
}
|
|
1451
|
-
if (BrowserFeatures.clipboard.readText && isLinux) {
|
|
1452
|
-
registerActiveInstanceAction({
|
|
1453
|
-
id: "workbench.action.terminal.pasteSelection" ,
|
|
1454
|
-
title: ( localize2(9002, 'Paste Selection into Active Terminal')),
|
|
1455
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1456
|
-
keybinding: [{
|
|
1457
|
-
linux: { primary: 1024 | 19 },
|
|
1458
|
-
weight: 200 ,
|
|
1459
|
-
when: TerminalContextKeys.focus
|
|
1460
|
-
}],
|
|
1461
|
-
run: (activeInstance) => activeInstance.pasteSelection()
|
|
1462
|
-
});
|
|
1463
|
-
}
|
|
1464
|
-
registerTerminalAction({
|
|
1465
|
-
id: "workbench.action.terminal.switchTerminal" ,
|
|
1466
|
-
title: ( localize2(9003, 'Switch Terminal')),
|
|
1467
|
-
precondition: sharedWhenClause.terminalAvailable,
|
|
1468
|
-
run: async (c, accessor, args) => {
|
|
1469
|
-
const item = toOptionalString(args);
|
|
1470
|
-
if (!item) {
|
|
1471
|
-
return;
|
|
1472
|
-
}
|
|
1473
|
-
if (item === switchTerminalActionViewItemSeparator) {
|
|
1474
|
-
c.service.refreshActiveGroup();
|
|
1475
|
-
return;
|
|
1476
|
-
}
|
|
1477
|
-
if (item === switchTerminalShowTabsTitle) {
|
|
1478
|
-
accessor.get(IConfigurationService).updateValue("terminal.integrated.tabs.enabled" , true);
|
|
1479
|
-
return;
|
|
1480
|
-
}
|
|
1481
|
-
const terminalIndexRe = /^([0-9]+): /;
|
|
1482
|
-
const indexMatches = terminalIndexRe.exec(item);
|
|
1483
|
-
if (indexMatches) {
|
|
1484
|
-
c.groupService.setActiveGroupByIndex(Number(indexMatches[1]) - 1);
|
|
1485
|
-
return c.groupService.showPanel(true);
|
|
1486
|
-
}
|
|
1487
|
-
const quickSelectProfiles = c.profileService.availableProfiles;
|
|
1488
|
-
const profileSelection = item.substring(4);
|
|
1489
|
-
if (quickSelectProfiles) {
|
|
1490
|
-
const profile = quickSelectProfiles.find(profile => profile.profileName === profileSelection);
|
|
1491
|
-
if (profile) {
|
|
1492
|
-
const instance = await c.service.createTerminal({
|
|
1493
|
-
config: profile
|
|
1494
|
-
});
|
|
1495
|
-
c.service.setActiveInstance(instance);
|
|
1496
|
-
}
|
|
1497
|
-
else {
|
|
1498
|
-
console.warn(`No profile with name "${profileSelection}"`);
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
else {
|
|
1502
|
-
console.warn(`Unmatched terminal item: "${item}"`);
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
});
|
|
1506
|
-
}
|
|
1507
|
-
function getSelectedInstances2(accessor, args) {
|
|
1508
|
-
const terminalService = accessor.get(ITerminalService);
|
|
1509
|
-
const result = [];
|
|
1510
|
-
const context = parseActionArgs(args);
|
|
1511
|
-
if (context && context.length > 0) {
|
|
1512
|
-
for (const instanceContext of context) {
|
|
1513
|
-
const instance = terminalService.getInstanceFromId(instanceContext.instanceId);
|
|
1514
|
-
if (instance) {
|
|
1515
|
-
result.push(instance);
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
if (result.length > 0) {
|
|
1519
|
-
return result;
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
return undefined;
|
|
1523
|
-
}
|
|
1524
|
-
function getSelectedInstances(accessor, args, args2) {
|
|
1525
|
-
const listService = accessor.get(IListService);
|
|
1526
|
-
const terminalService = accessor.get(ITerminalService);
|
|
1527
|
-
const terminalGroupService = accessor.get(ITerminalGroupService);
|
|
1528
|
-
const result = [];
|
|
1529
|
-
const list = listService.lastFocusedList;
|
|
1530
|
-
const selections = list?.getSelection();
|
|
1531
|
-
if (terminalGroupService.lastAccessedMenu === 'inline-tab' && !selections?.length) {
|
|
1532
|
-
const instance = terminalGroupService.activeInstance;
|
|
1533
|
-
return instance ? [terminalGroupService.activeInstance] : undefined;
|
|
1534
|
-
}
|
|
1535
|
-
if (!list || !selections) {
|
|
1536
|
-
return undefined;
|
|
1537
|
-
}
|
|
1538
|
-
const focused = list.getFocus();
|
|
1539
|
-
if (focused.length === 1 && !selections.includes(focused[0])) {
|
|
1540
|
-
result.push(terminalService.getInstanceFromIndex(focused[0]));
|
|
1541
|
-
return result;
|
|
1542
|
-
}
|
|
1543
|
-
for (const selection of selections) {
|
|
1544
|
-
result.push(terminalService.getInstanceFromIndex(selection));
|
|
1545
|
-
}
|
|
1546
|
-
return result.filter(r => !!r);
|
|
1547
|
-
}
|
|
1548
|
-
function validateTerminalName(name) {
|
|
1549
|
-
if (!name || name.trim().length === 0) {
|
|
1550
|
-
return {
|
|
1551
|
-
content: ( localize(9004, "Providing no name will reset it to the default value")),
|
|
1552
|
-
severity: Severity$1.Info
|
|
1553
|
-
};
|
|
1554
|
-
}
|
|
1555
|
-
return null;
|
|
1556
|
-
}
|
|
1557
|
-
function convertOptionsOrProfileToOptions(optionsOrProfile) {
|
|
1558
|
-
if (isObject(optionsOrProfile) && 'profileName' in optionsOrProfile) {
|
|
1559
|
-
return { config: optionsOrProfile, location: optionsOrProfile.location };
|
|
1560
|
-
}
|
|
1561
|
-
return optionsOrProfile;
|
|
1562
|
-
}
|
|
1563
|
-
let newWithProfileAction;
|
|
1564
|
-
function refreshTerminalActions(detectedProfiles) {
|
|
1565
|
-
const profileEnum = createProfileSchemaEnums(detectedProfiles);
|
|
1566
|
-
newWithProfileAction?.dispose();
|
|
1567
|
-
newWithProfileAction = registerAction2(class extends Action2 {
|
|
1568
|
-
constructor() {
|
|
1569
|
-
super({
|
|
1570
|
-
id: "workbench.action.terminal.newWithProfile" ,
|
|
1571
|
-
title: ( localize2(9005, 'Create New Terminal (With Profile)')),
|
|
1572
|
-
f1: true,
|
|
1573
|
-
category,
|
|
1574
|
-
precondition: ( (ContextKeyExpr.or(
|
|
1575
|
-
TerminalContextKeys.processSupported,
|
|
1576
|
-
TerminalContextKeys.webExtensionContributedProfile
|
|
1577
|
-
))),
|
|
1578
|
-
metadata: {
|
|
1579
|
-
description: "workbench.action.terminal.newWithProfile" ,
|
|
1580
|
-
args: [{
|
|
1581
|
-
name: 'args',
|
|
1582
|
-
schema: {
|
|
1583
|
-
type: 'object',
|
|
1584
|
-
required: ['profileName'],
|
|
1585
|
-
properties: {
|
|
1586
|
-
profileName: {
|
|
1587
|
-
description: ( localize(9006, "The name of the profile to create")),
|
|
1588
|
-
type: 'string',
|
|
1589
|
-
enum: profileEnum.values,
|
|
1590
|
-
markdownEnumDescriptions: profileEnum.markdownDescriptions
|
|
1591
|
-
},
|
|
1592
|
-
location: {
|
|
1593
|
-
description: ( localize(9007, "Where to create the terminal")),
|
|
1594
|
-
type: 'string',
|
|
1595
|
-
enum: ['view', 'editor'],
|
|
1596
|
-
enumDescriptions: [
|
|
1597
|
-
( localize(9008, 'Create the terminal in the terminal view')),
|
|
1598
|
-
( localize(9009, 'Create the terminal in the editor')),
|
|
1599
|
-
]
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
}]
|
|
1604
|
-
},
|
|
1605
|
-
});
|
|
1606
|
-
}
|
|
1607
|
-
async run(accessor, eventOrOptionsOrProfile, profile) {
|
|
1608
|
-
const c = getTerminalServices(accessor);
|
|
1609
|
-
const workspaceContextService = accessor.get(IWorkspaceContextService);
|
|
1610
|
-
const commandService = accessor.get(ICommandService);
|
|
1611
|
-
let event;
|
|
1612
|
-
let options;
|
|
1613
|
-
let instance;
|
|
1614
|
-
let cwd;
|
|
1615
|
-
if (isObject(eventOrOptionsOrProfile) && eventOrOptionsOrProfile && 'profileName' in eventOrOptionsOrProfile) {
|
|
1616
|
-
const config = c.profileService.availableProfiles.find(profile => profile.profileName === eventOrOptionsOrProfile.profileName);
|
|
1617
|
-
if (!config) {
|
|
1618
|
-
throw ( (new Error(`Could not find terminal profile "${eventOrOptionsOrProfile.profileName}"`)));
|
|
1619
|
-
}
|
|
1620
|
-
options = { config };
|
|
1621
|
-
if ('location' in eventOrOptionsOrProfile) {
|
|
1622
|
-
switch (eventOrOptionsOrProfile.location) {
|
|
1623
|
-
case 'editor':
|
|
1624
|
-
options.location = TerminalLocation.Editor;
|
|
1625
|
-
break;
|
|
1626
|
-
case 'view':
|
|
1627
|
-
options.location = TerminalLocation.Panel;
|
|
1628
|
-
break;
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
}
|
|
1632
|
-
else if (isMouseEvent(eventOrOptionsOrProfile) || isPointerEvent(eventOrOptionsOrProfile) || isKeyboardEvent(eventOrOptionsOrProfile)) {
|
|
1633
|
-
event = eventOrOptionsOrProfile;
|
|
1634
|
-
options = profile ? { config: profile } : undefined;
|
|
1635
|
-
}
|
|
1636
|
-
else {
|
|
1637
|
-
options = convertOptionsOrProfileToOptions(eventOrOptionsOrProfile);
|
|
1638
|
-
}
|
|
1639
|
-
if (event && (event.altKey || event.ctrlKey)) {
|
|
1640
|
-
const parentTerminal = c.service.activeInstance;
|
|
1641
|
-
if (parentTerminal) {
|
|
1642
|
-
await c.service.createTerminal({ location: { parentTerminal }, config: options?.config });
|
|
1643
|
-
return;
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
const folders = workspaceContextService.getWorkspace().folders;
|
|
1647
|
-
if (folders.length > 1) {
|
|
1648
|
-
const options = {
|
|
1649
|
-
placeHolder: ( localize(8940, "Select current working directory for new terminal"))
|
|
1650
|
-
};
|
|
1651
|
-
const workspace = await commandService.executeCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID, [options]);
|
|
1652
|
-
if (!workspace) {
|
|
1653
|
-
return;
|
|
1654
|
-
}
|
|
1655
|
-
cwd = workspace.uri;
|
|
1656
|
-
}
|
|
1657
|
-
if (options) {
|
|
1658
|
-
options.cwd = cwd;
|
|
1659
|
-
instance = await c.service.createTerminal(options);
|
|
1660
|
-
}
|
|
1661
|
-
else {
|
|
1662
|
-
instance = await c.service.showProfileQuickPick('createInstance', cwd);
|
|
1663
|
-
}
|
|
1664
|
-
if (instance) {
|
|
1665
|
-
c.service.setActiveInstance(instance);
|
|
1666
|
-
await focusActiveTerminal(instance, c);
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
});
|
|
1670
|
-
return newWithProfileAction;
|
|
1671
|
-
}
|
|
1672
|
-
function getResourceOrActiveInstance(c, resource) {
|
|
1673
|
-
return c.service.getInstanceFromResource(toOptionalUri(resource)) || c.service.activeInstance;
|
|
1674
|
-
}
|
|
1675
|
-
async function pickTerminalCwd(accessor, cancel) {
|
|
1676
|
-
const quickInputService = accessor.get(IQuickInputService);
|
|
1677
|
-
const labelService = accessor.get(ILabelService);
|
|
1678
|
-
const contextService = accessor.get(IWorkspaceContextService);
|
|
1679
|
-
const modelService = accessor.get(IModelService);
|
|
1680
|
-
const languageService = accessor.get(ILanguageService);
|
|
1681
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
1682
|
-
const configurationResolverService = accessor.get(IConfigurationResolverService);
|
|
1683
|
-
const folders = contextService.getWorkspace().folders;
|
|
1684
|
-
if (!folders.length) {
|
|
1685
|
-
return;
|
|
1686
|
-
}
|
|
1687
|
-
const folderCwdPairs = await Promise.all(( (folders.map(
|
|
1688
|
-
e => resolveWorkspaceFolderCwd(e, configurationService, configurationResolverService)
|
|
1689
|
-
))));
|
|
1690
|
-
const shrinkedPairs = shrinkWorkspaceFolderCwdPairs(folderCwdPairs);
|
|
1691
|
-
if (shrinkedPairs.length === 1) {
|
|
1692
|
-
return shrinkedPairs[0];
|
|
1693
|
-
}
|
|
1694
|
-
const folderPicks = ( (shrinkedPairs.map(pair => {
|
|
1695
|
-
const label = pair.folder.name;
|
|
1696
|
-
const description = pair.isOverridden
|
|
1697
|
-
? ( localize(
|
|
1698
|
-
9010,
|
|
1699
|
-
"(Overriden) {0}",
|
|
1700
|
-
labelService.getUriLabel(pair.cwd, { relative: !pair.isAbsolute })
|
|
1701
|
-
))
|
|
1702
|
-
: labelService.getUriLabel(dirname(pair.cwd), { relative: true });
|
|
1703
|
-
return {
|
|
1704
|
-
label,
|
|
1705
|
-
description: description !== label ? description : undefined,
|
|
1706
|
-
pair: pair,
|
|
1707
|
-
iconClasses: getIconClasses(modelService, languageService, pair.cwd, FileKind.ROOT_FOLDER)
|
|
1708
|
-
};
|
|
1709
|
-
})));
|
|
1710
|
-
const options = {
|
|
1711
|
-
placeHolder: ( localize(8940, "Select current working directory for new terminal")),
|
|
1712
|
-
matchOnDescription: true,
|
|
1713
|
-
canPickMany: false,
|
|
1714
|
-
};
|
|
1715
|
-
const token = CancellationToken.None;
|
|
1716
|
-
const pick = await quickInputService.pick(folderPicks, options, token);
|
|
1717
|
-
return pick?.pair;
|
|
1718
|
-
}
|
|
1719
|
-
async function resolveWorkspaceFolderCwd(folder, configurationService, configurationResolverService) {
|
|
1720
|
-
const cwdConfig = configurationService.getValue("terminal.integrated.cwd" , { resource: folder.uri });
|
|
1721
|
-
if (!isString(cwdConfig) || cwdConfig.length === 0) {
|
|
1722
|
-
return { folder, cwd: folder.uri, isAbsolute: false, isOverridden: false };
|
|
1723
|
-
}
|
|
1724
|
-
const resolvedCwdConfig = await configurationResolverService.resolveAsync(folder, cwdConfig);
|
|
1725
|
-
return isAbsolute(resolvedCwdConfig) || resolvedCwdConfig.startsWith(AbstractVariableResolverService.VARIABLE_LHS)
|
|
1726
|
-
? { folder, isAbsolute: true, isOverridden: true, cwd: ( (URI.from({ ...folder.uri, path: resolvedCwdConfig }))) }
|
|
1727
|
-
: { folder, isAbsolute: false, isOverridden: true, cwd: URI.joinPath(folder.uri, resolvedCwdConfig) };
|
|
1728
|
-
}
|
|
1729
|
-
function shrinkWorkspaceFolderCwdPairs(pairs) {
|
|
1730
|
-
const map = ( (new Map()));
|
|
1731
|
-
for (const pair of pairs) {
|
|
1732
|
-
const key = ( (pair.cwd.toString()));
|
|
1733
|
-
const value = map.get(key);
|
|
1734
|
-
if (!value || key === ( (pair.folder.uri.toString()))) {
|
|
1735
|
-
map.set(key, pair);
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
const selectedPairs = ( (new Set( (map.values()))));
|
|
1739
|
-
const selectedPairsInOrder = pairs.filter(x => ( (selectedPairs.has(x))));
|
|
1740
|
-
return selectedPairsInOrder;
|
|
1741
|
-
}
|
|
1742
|
-
async function focusActiveTerminal(instance, c) {
|
|
1743
|
-
if (instance.target === TerminalLocation.Editor) {
|
|
1744
|
-
await c.editorService.revealActiveEditor();
|
|
1745
|
-
await instance.focusWhenReady(true);
|
|
1746
|
-
}
|
|
1747
|
-
else {
|
|
1748
|
-
await c.groupService.showPanel(true);
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
async function renameWithQuickPick(c, accessor, resource) {
|
|
1752
|
-
let instance = resource;
|
|
1753
|
-
if (!instance || !instance?.rename) {
|
|
1754
|
-
instance = getResourceOrActiveInstance(c, resource);
|
|
1755
|
-
}
|
|
1756
|
-
if (instance) {
|
|
1757
|
-
const title = await accessor.get(IQuickInputService).input({
|
|
1758
|
-
value: instance.title,
|
|
1759
|
-
prompt: ( localize(9011, "Enter terminal name")),
|
|
1760
|
-
});
|
|
1761
|
-
instance.rename(title);
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
function toOptionalUri(obj) {
|
|
1765
|
-
return URI.isUri(obj) ? obj : undefined;
|
|
1766
|
-
}
|
|
1767
|
-
function toOptionalString(obj) {
|
|
1768
|
-
return isString(obj) ? obj : undefined;
|
|
1769
|
-
}
|
|
1770
|
-
export { TerminalLaunchHelpAction, getCwdForSplit, refreshTerminalActions, registerActiveInstanceAction, registerActiveXtermAction, registerContextualInstanceAction, registerTerminalAction, registerTerminalActions, shrinkWorkspaceFolderCwdPairs, switchTerminalActionViewItemSeparator, switchTerminalShowTabsTitle, terminalSendSequenceCommand, validateTerminalName };
|