@codingame/monaco-vscode-api 1.79.1 → 1.79.2-next.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 +11 -2
- package/dist/api.js +10 -8
- package/dist/composite.d.ts +65 -0
- package/dist/configurationRegistry.d.ts +212 -0
- package/dist/contextkey.d.ts +1 -1
- package/dist/default-extensions/json.js +1 -0
- package/dist/default-extensions/theme-defaults.js +2 -2
- package/dist/editorBrowser.d.ts +272 -3
- package/dist/event.d.ts +6 -1
- package/dist/{extension-tools-0c4c1ad7.js → extension-tools-3c2bf0a4.js} +698 -507
- package/dist/extensions.d.ts +3 -2
- package/dist/extensions.d2.ts +6 -17
- package/dist/extensionsRegistry.d.ts +15 -9
- package/dist/files.d.ts +71 -7
- package/dist/jsonSchema.d.ts +1 -1
- package/dist/keybinding.d.ts +2 -2
- package/dist/languageFeatures.d.ts +703 -61
- package/dist/monaco.d.ts +5 -4
- package/dist/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/browser/notebookEditor.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2 -0
- package/dist/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -1
- package/dist/platform.d.ts +11 -0
- package/dist/rollup-extension-directory-plugin.js +1 -1
- package/dist/rollup-vsix-plugin.js +2 -2
- package/dist/service-override/configuration.d.ts +5 -206
- package/dist/service-override/dialogs.js +16 -1
- package/dist/service-override/files.d.ts +2 -2
- package/dist/service-override/files.js +1 -1
- package/dist/service-override/markers.d.ts +7 -0
- package/dist/service-override/markers.js +6 -0
- package/dist/service-override/output.d.ts +7 -0
- package/dist/service-override/output.js +22 -0
- package/dist/service-override/preferences.js +7 -1
- package/dist/service-override/quickaccess.js +0 -9
- package/dist/service-override/search.d.ts +7 -0
- package/dist/service-override/search.js +19 -0
- package/dist/service-override/terminal.d.ts +607 -0
- package/dist/service-override/terminal.js +98 -0
- package/dist/service-override/tools/editor.js +1 -1
- package/dist/service-override/views.d.ts +561 -335
- package/dist/service-override/views.js +51 -11
- package/dist/services.d.ts +2627 -108
- package/dist/services.js +3 -0
- package/dist/severity.d.ts +16 -0
- package/dist/uri.d.ts +22 -11
- package/dist/views.d.ts +270 -0
- package/dist/vscode/vs/base/common/processes.js +24 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/decorations.js +20 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/delegatingEditorImpl.js +106 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorSash.js +59 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +41 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.js +369 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffModel.js +247 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.js +179 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/overviewRulerPart.js +121 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/style.css.js +4 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/unchangedRanges.js +184 -0
- package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/utils.js +88 -0
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagement.js +38 -1
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagementUtil.js +5 -1
- package/dist/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +13 -5
- package/dist/vscode/vs/platform/files/common/fileService.js +43 -5
- package/dist/vscode/vs/platform/files/common/files.js +3 -1
- package/dist/vscode/vs/platform/languagePacks/common/languagePacks.js +4 -1
- package/dist/vscode/vs/platform/log/common/bufferLog.js +34 -0
- package/dist/vscode/vs/platform/log/common/fileLog.js +105 -0
- package/dist/vscode/vs/platform/quickinput/browser/quickPickPin.js +1 -1
- package/dist/vscode/vs/platform/remote/common/remoteAuthorityResolver.js +20 -1
- package/dist/vscode/vs/platform/request/browser/requestService.js +1 -1
- package/dist/vscode/vs/platform/request/common/request.js +3 -3
- package/dist/vscode/vs/platform/storage/common/storage.js +3 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +39 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +565 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +27 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +22 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +46 -0
- package/dist/vscode/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +80 -0
- package/dist/vscode/vs/platform/terminal/common/environmentVariable.js +7 -0
- package/dist/vscode/vs/platform/terminal/common/environmentVariableCollection.js +196 -0
- package/dist/vscode/vs/platform/terminal/common/environmentVariableShared.js +23 -0
- package/dist/vscode/vs/platform/terminal/common/terminal.js +21 -1
- package/dist/vscode/vs/platform/terminal/common/terminalDataBuffering.js +45 -0
- package/dist/vscode/vs/platform/terminal/common/terminalEnvironment.js +37 -0
- package/dist/vscode/vs/platform/terminal/common/terminalPlatformConfiguration.js +622 -0
- package/dist/vscode/vs/platform/terminal/common/terminalProfiles.js +107 -0
- package/dist/vscode/vs/platform/terminal/common/terminalRecorder.js +66 -0
- package/dist/vscode/vs/platform/terminal/common/terminalStrings.js +16 -0
- package/dist/vscode/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +321 -0
- package/dist/vscode/vs/platform/userDataSync/common/settingsMerge.js +39 -1
- package/dist/vscode/vs/platform/userDataSync/common/userDataSync.js +19 -0
- package/dist/vscode/vs/platform/window/common/window.js +7 -1
- package/dist/vscode/vs/platform/workspace/common/canonicalUri.js +3 -0
- package/dist/vscode/vs/platform/workspace/common/virtualWorkspace.js +4 -1
- package/dist/vscode/vs/platform/workspaces/common/workspaces.js +2 -2
- package/dist/vscode/vs/workbench/api/browser/mainThreadCommands.js +2 -3
- package/dist/vscode/vs/workbench/api/browser/mainThreadEditorTabs.js +473 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadLanguageFeatures.js +45 -38
- package/dist/vscode/vs/workbench/api/browser/mainThreadSearch.js +146 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadStatusBar.js +33 -52
- package/dist/vscode/vs/workbench/api/browser/mainThreadTerminalService.js +395 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadTheming.js +22 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadTreeViews.js +10 -5
- package/dist/vscode/vs/workbench/api/browser/mainThreadWindow.js +11 -4
- package/dist/vscode/vs/workbench/api/browser/mainThreadWorkspace.js +34 -11
- package/dist/vscode/vs/workbench/api/browser/statusBarExtensionPoint.js +81 -0
- package/dist/vscode/vs/workbench/api/common/extHost.protocol.js +7 -2
- package/dist/vscode/vs/workbench/api/common/extHostDebugService.js +4 -13
- package/dist/vscode/vs/workbench/api/common/extHostExtensionService.js +30 -15
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemConsumer.js +20 -6
- package/dist/vscode/vs/workbench/api/common/extHostLanguageFeatures.js +41 -8
- package/dist/vscode/vs/workbench/api/common/extHostManagedSockets.js +3 -0
- package/dist/vscode/vs/workbench/api/common/extHostSearch.js +109 -0
- package/dist/vscode/vs/workbench/api/common/extHostStatusBar.js +33 -6
- package/dist/vscode/vs/workbench/api/common/extHostTerminalService.js +879 -1
- package/dist/vscode/vs/workbench/api/common/extHostTheming.js +38 -0
- package/dist/vscode/vs/workbench/api/common/extHostTreeViews.js +8 -5
- package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +15 -17
- package/dist/vscode/vs/workbench/api/common/extHostTypes.js +117 -4
- package/dist/vscode/vs/workbench/api/common/extHostWindow.js +28 -6
- package/dist/vscode/vs/workbench/api/common/extHostWorkspace.js +28 -0
- package/dist/vscode/vs/workbench/api/common/shared/dataTransferCache.js +11 -14
- package/dist/vscode/vs/workbench/api/node/extHostTerminalService.js +22 -0
- package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +2 -1
- package/dist/vscode/vs/workbench/browser/actions/windowActions.js +2 -2
- package/dist/vscode/vs/workbench/browser/dnd.js +56 -2
- package/dist/vscode/vs/workbench/browser/parts/compositePart.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/dialogs/dialogHandler.js +2 -2
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +1 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.js +1 -0
- package/dist/vscode/vs/workbench/browser/parts/editor/editorCommands.js +9 -10
- package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupView.js +15 -9
- package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupWatermark.js +13 -17
- package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorsObserver.js +2 -2
- package/dist/vscode/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/noTabsTitleControl.js +3 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/tabsTitleControl.js +60 -11
- package/dist/vscode/vs/workbench/browser/parts/editor/textDiffEditor.js +16 -10
- package/dist/vscode/vs/workbench/browser/parts/editor/textResourceEditor.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/statusbar/media/statusbarpart.css.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/views/checkbox.js +10 -0
- package/dist/vscode/vs/workbench/browser/parts/views/treeView.js +78 -14
- package/dist/vscode/vs/workbench/browser/parts/views/viewPaneContainer.js +1 -1
- package/dist/vscode/vs/workbench/browser/workbench.contribution.js +65 -6
- package/dist/vscode/vs/workbench/common/configuration.js +8 -1
- package/dist/vscode/vs/workbench/common/contextkeys.js +9 -1
- package/dist/vscode/vs/workbench/common/editor/editorGroupModel.js +5 -1
- package/dist/vscode/vs/workbench/common/editor/resourceEditorInput.js +6 -3
- package/dist/vscode/vs/workbench/common/editor/textResourceEditorInput.js +9 -6
- package/dist/vscode/vs/workbench/common/editor.js +1 -5
- package/dist/vscode/vs/workbench/common/resources.js +111 -34
- package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +1 -1
- package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +1 -1
- package/dist/vscode/vs/workbench/contrib/chat/browser/chat.js +3 -0
- package/dist/vscode/vs/workbench/contrib/chat/common/chatService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +6 -4
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +250 -0
- package/dist/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput.js +290 -0
- package/dist/vscode/vs/workbench/contrib/customEditor/common/customEditor.js +3 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugActionViewItems.js +1 -0
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugCommands.js +2 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +20 -20
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorActions.js +5 -3
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorContribution.js +5 -2
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugHover.js +33 -6
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugSession.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugTaskRunner.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/repl.js +3 -3
- package/dist/vscode/vs/workbench/contrib/debug/common/debugModel.js +29 -17
- package/dist/vscode/vs/workbench/contrib/debug/common/debugStorage.js +11 -10
- package/dist/vscode/vs/workbench/contrib/debug/common/debugger.js +10 -6
- package/dist/vscode/vs/workbench/contrib/extensions/browser/extensionsActions.js +2514 -0
- package/dist/vscode/vs/workbench/contrib/extensions/browser/extensionsIcons.js +82 -0
- package/dist/vscode/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/extensions/common/extensions.js +6 -1
- package/dist/vscode/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +16 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +2 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +2 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/explorerService.js +10 -6
- package/dist/vscode/vs/workbench/contrib/files/browser/explorerViewlet.js +3 -18
- package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.contribution.js +37 -2
- package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.js +65 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/fileCommands.js +3 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/fileConstants.js +3 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/files.contribution.js +41 -6
- package/dist/vscode/vs/workbench/contrib/files/browser/files.js +1 -0
- package/dist/vscode/vs/workbench/contrib/files/browser/views/explorerView.js +3 -3
- package/dist/vscode/vs/workbench/contrib/files/browser/views/explorerViewer.js +6 -2
- package/dist/vscode/vs/workbench/contrib/files/common/explorerModel.js +16 -9
- package/dist/vscode/vs/workbench/contrib/files/common/files.js +1 -6
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +200 -0
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markers.contribution.js +586 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersFilterOptions.js +75 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersModel.js +201 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersTable.js +451 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersTreeViewer.js +670 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersView.js +857 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersViewActions.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/markersViewActions.js +132 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/media/markers.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/markers/browser/messages.js +171 -0
- package/dist/vscode/vs/workbench/contrib/markers/common/markers.js +15 -1
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +135 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +421 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +55 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +334 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +606 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +36 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/utils.js +68 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +2 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +158 -0
- package/dist/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser.js +6 -1
- package/dist/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookCommon.js +16 -1
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookService.js +3 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/logViewer.js +64 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/output.contribution.js +378 -0
- package/dist/vscode/vs/workbench/contrib/output/browser/outputServices.js +39 -3
- package/dist/vscode/vs/workbench/contrib/output/browser/outputView.js +220 -0
- package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModel.js +12 -3
- package/dist/vscode/vs/workbench/contrib/output/common/outputLinkComputer.js +129 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +270 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/keybindingsEditor.js +1080 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/keybindings.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/keybindingsEditor.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/preferences.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferences.contribution.js +1154 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesActions.js +94 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesEditor.js +47 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesIcons.js +37 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesRenderers.js +731 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesSearch.js +271 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +479 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsEditor2.js +1465 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.js +506 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsLayout.js +296 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsSearchMenu.js +79 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsTree.js +1984 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +759 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsWidgets.js +1008 -0
- package/dist/vscode/vs/workbench/contrib/preferences/browser/tocTree.js +196 -0
- package/dist/vscode/vs/workbench/contrib/preferences/common/preferences.js +68 -0
- package/dist/vscode/vs/workbench/contrib/preferences/common/preferencesContribution.js +157 -0
- package/dist/vscode/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +67 -0
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +16 -16
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +1 -2
- package/dist/vscode/vs/workbench/contrib/remote/browser/remoteExplorer.js +23 -2
- package/dist/vscode/vs/workbench/contrib/remote/browser/tunnelView.js +5 -5
- package/dist/vscode/vs/workbench/contrib/search/browser/media/searchview.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/patternInputWidget.js +217 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/replace.js +3 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/replaceContributions.js +7 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/replaceService.js +222 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/search.contribution.js +54 -15
- package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsBase.js +17 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchFindInput.js +41 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchIcons.js +35 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchMessage.js +58 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchModel.js +1842 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchNotebookHelpers.js +49 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchResultsView.js +379 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchView.js +1867 -0
- package/dist/vscode/vs/workbench/contrib/search/browser/searchWidget.js +628 -0
- package/dist/vscode/vs/workbench/contrib/search/common/constants.js +30 -1
- package/dist/vscode/vs/workbench/contrib/search/common/search.js +9 -1
- package/dist/vscode/vs/workbench/contrib/search/common/searchHistoryService.js +42 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +477 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditor.js +697 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +188 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +295 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +135 -0
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +268 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/tabCompletion.js +2 -2
- package/dist/vscode/vs/workbench/contrib/tasks/common/taskService.js +16 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +119 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/scrollbar.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/terminal.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/widgets.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/media/xterm.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminal.contribution.js +238 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalActions.js +1930 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalCommands.js +22 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalConfigHelper.js +213 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +17 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditor.js +186 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +199 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditorService.js +239 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalExtensions.js +22 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalGroup.js +482 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalGroupService.js +372 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalIcon.js +60 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalIcons.js +37 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalInstance.js +2123 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalInstanceService.js +79 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalMainContribution.js +82 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalMenus.js +850 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +142 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +618 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileQuickpick.js +278 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.js +417 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileService.js +213 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +144 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +267 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalService.js +1063 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalStatusList.js +108 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTabbedView.js +417 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTabsList.js +680 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTooltip.js +72 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalUri.js +39 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalView.js +535 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +36 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +469 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +97 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +56 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +416 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +390 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +587 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/environmentVariable.js +3 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/environmentVariableService.js +94 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/history.js +356 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminal.js +266 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -16
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalConfiguration.js +965 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalContextKey.js +157 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalEnvironment.js +272 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalExtensionPoints.js +27 -0
- package/dist/vscode/vs/workbench/contrib/terminal/common/terminalStrings.js +86 -0
- package/dist/vscode/vs/workbench/contrib/terminal/electron-sandbox/terminalProfileResolverService.js +46 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/links/browser/links.js +3 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkProviderService.js +26 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix.js +3 -0
- package/dist/vscode/vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixService.js +143 -0
- package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput.js +85 -0
- package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.js +52 -0
- package/dist/vscode/vs/workbench/services/actions/common/menusExtensionPoint.js +14 -6
- package/dist/vscode/vs/workbench/services/assignment/common/assignmentService.js +3 -0
- package/dist/vscode/vs/workbench/services/configuration/browser/configurationService.js +13 -13
- package/dist/vscode/vs/workbench/services/configuration/common/configuration.js +2 -1
- package/dist/vscode/vs/workbench/services/configuration/common/configurationEditing.js +2 -2
- package/dist/vscode/vs/workbench/services/configuration/common/jsonEditingService.js +2 -2
- package/dist/vscode/vs/workbench/services/dialogs/browser/abstractFileDialogService.js +302 -0
- package/dist/vscode/vs/workbench/services/dialogs/browser/simpleFileDialog.js +971 -0
- package/dist/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.js +3 -2
- package/dist/vscode/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.js +4 -0
- package/dist/vscode/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +2 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensionManifestPropertiesService.js +3 -0
- package/dist/vscode/vs/workbench/services/extensions/common/extensions.js +14 -2
- package/dist/vscode/vs/workbench/services/extensions/common/extensionsApiProposals.js +10 -1
- package/dist/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +70 -3
- package/dist/vscode/vs/workbench/services/hover/browser/hoverService.js +1 -1
- package/dist/vscode/vs/workbench/services/hover/browser/hoverWidget.js +2 -1
- package/dist/vscode/vs/workbench/services/hover/browser/media/hover.css.js +1 -1
- package/dist/vscode/vs/workbench/services/keybinding/common/keybindingEditing.js +275 -0
- package/dist/vscode/vs/workbench/services/localization/common/locale.js +3 -0
- package/dist/vscode/vs/workbench/services/log/common/logConstants.js +2 -0
- package/dist/vscode/vs/workbench/services/output/common/output.js +4 -1
- package/dist/vscode/vs/workbench/services/preferences/common/preferences.js +22 -1
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesModels.js +6 -0
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesValidation.js +37 -1
- package/dist/vscode/vs/workbench/services/remote/common/remoteAgentService.js +69 -0
- package/dist/vscode/vs/workbench/services/remote/common/remoteExplorerService.js +66 -27
- package/dist/vscode/vs/workbench/services/search/common/fileSearchManager.js +265 -0
- package/dist/vscode/vs/workbench/services/search/common/queryBuilder.js +6 -0
- package/dist/vscode/vs/workbench/services/search/common/replace.js +203 -0
- package/dist/vscode/vs/workbench/services/search/common/search.js +227 -1
- package/dist/vscode/vs/workbench/services/search/common/searchExtTypes.js +6 -0
- package/dist/vscode/vs/workbench/services/search/common/searchHelpers.js +72 -0
- package/dist/vscode/vs/workbench/services/search/common/searchService.js +355 -0
- package/dist/vscode/vs/workbench/services/search/common/textSearchManager.js +309 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/media/suggest.css.js +4 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleCompletionItem.js +10 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleCompletionModel.js +98 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +399 -0
- package/dist/vscode/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +83 -0
- package/dist/vscode/vs/workbench/services/terminal/common/embedderTerminalService.js +3 -0
- package/dist/vscode/vs/workbench/services/textfile/browser/textFileService.js +1 -1
- package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModel.js +10 -3
- package/dist/vscode/vs/workbench/services/themes/browser/fileIconThemeData.js +3 -3
- package/dist/vscode/vs/workbench/services/themes/browser/productIconThemeData.js +3 -3
- package/dist/vscode/vs/workbench/services/themes/common/colorThemeData.js +3 -3
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput.js +6 -4
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorModel.js +3 -0
- package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js +4 -0
- package/dist/vscode/vs/workbench/services/userActivity/common/userActivityRegistry.js +15 -0
- package/dist/vscode/vs/workbench/services/userActivity/common/userActivityService.js +37 -0
- package/dist/vscode/vs/workbench/services/userDataSync/common/userDataSync.js +7 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService.js +40 -0
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyService.js +12 -0
- package/dist/vscode/vs/workbench/services/workspaces/common/canonicalUriService.js +19 -0
- package/dist/vscode-default-extensions/css/syntaxes/css.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/json/package.json.js +1 -1
- package/dist/vscode-default-extensions/json/syntaxes/JSONC.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/json/syntaxes/JSONL.tmLanguage.json.extensionResource.js +2 -0
- package/dist/vscode-default-extensions/latex/syntaxes/Bibtex.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/LaTeX.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/TeX.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/lua/syntaxes/lua.tmLanguage.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/perl/package.json.js +1 -1
- package/dist/vscode-default-extensions/php/snippets/php.code-snippets.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/sql/language-configuration.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-abyss/themes/abyss-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/package.json.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/dark_modern.json.extensionResource.js +2 -0
- package/dist/vscode-default-extensions/theme-defaults/themes/dark_vs.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/hc_black.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/hc_light.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-defaults/themes/light_modern.json.extensionResource.js +2 -0
- package/dist/vscode-default-extensions/theme-defaults/themes/light_vs.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-monokai/themes/monokai-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-quietlight/themes/quietlight-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-red/themes/Red-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-seti/icons/vs-seti-icon-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-solarized-light/themes/solarized-light-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json.extensionResource.js +1 -1
- package/dist/vscode-default-extensions/vb/language-configuration.json.extensionResource.js +1 -1
- package/dist/vscode-services/env.js +4 -2
- package/dist/vscode-services/extHost.js +32 -48
- package/dist/vscode-services/missing-services.js +407 -29
- package/dist/vscode-services/window.js +59 -65
- package/dist/vscode-services/workspace.js +19 -5
- package/dist/workers/outputLinkComputer.worker.d.ts +2 -0
- package/dist/workers/outputLinkComputer.worker.js +3 -0
- package/dist/workspace.d.ts +1 -1
- package/monaco-editor-treemending.patch +1305 -1184
- package/package.json +65 -19
- package/dist/activity.d.ts +0 -2802
- package/dist/collections.d.ts +0 -7
- package/dist/colorRegistry.d.ts +0 -710
- package/dist/vscode/vs/platform/product/common/product.js +0 -48
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionFollowups.js +0 -30
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionInputPart.js +0 -196
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionListRenderer.js +0 -622
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionOptions.js +0 -77
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.js +0 -311
- package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/media/interactiveSession.css.js +0 -4
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionContextKeys.js +0 -56
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionModel.js +0 -305
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionService.js +0 -13
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionServiceImpl.js +0 -379
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionViewModel.js +0 -207
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionWidgetHistoryService.js +0 -3
- package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionWordCounter.js +0 -25
- package/dist/vscode-default-extensions/theme-defaults/themes/dark_plus_experimental.json.extensionResource.js +0 -2
- package/dist/vscode-default-extensions/theme-defaults/themes/light_plus_experimental.json.extensionResource.js +0 -2
|
@@ -0,0 +1,1063 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import { timeout } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
4
|
+
import { debounce } from 'monaco-editor/esm/vs/base/common/decorators.js';
|
|
5
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
6
|
+
import { dispose, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
7
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
8
|
+
import { isWeb, isMacintosh } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
9
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
10
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
11
|
+
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
12
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
13
|
+
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
14
|
+
import { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
|
|
15
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
16
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
17
|
+
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
18
|
+
import { TerminalLocation, TerminalExitReason, TitleEventSource } from '../../../../platform/terminal/common/terminal.js';
|
|
19
|
+
import { formatMessageForTerminal } from '../../../../platform/terminal/common/terminalStrings.js';
|
|
20
|
+
import { iconForeground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
21
|
+
import { getIconRegistry } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
22
|
+
import { ColorScheme } from 'monaco-editor/esm/vs/platform/theme/common/theme.js';
|
|
23
|
+
import { Themable, IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
24
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
25
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
26
|
+
import { VirtualWorkspaceContext } from '../../../common/contextkeys.js';
|
|
27
|
+
import { IViewsService } from '../../../common/views.js';
|
|
28
|
+
import { ITerminalEditorService, ITerminalGroupService, ITerminalInstanceService, ITerminalService } from './terminal.js';
|
|
29
|
+
import { getCwdForSplit } from './terminalActions.js';
|
|
30
|
+
import { TerminalConfigHelper } from './terminalConfigHelper.js';
|
|
31
|
+
import { TerminalEditorInput } from './terminalEditorInput.js';
|
|
32
|
+
import { getUriClasses, getColorStyleContent } from './terminalIcon.js';
|
|
33
|
+
import { TerminalProfileQuickpick } from './terminalProfileQuickpick.js';
|
|
34
|
+
import { getTerminalUri, getInstanceFromResource, parseTerminalUri } from './terminalUri.js';
|
|
35
|
+
import { TERMINAL_VIEW_ID, ITerminalProfileService } from '../common/terminal.js';
|
|
36
|
+
import { TerminalContextKeys } from '../common/terminalContextKey.js';
|
|
37
|
+
import { columnToEditorGroup } from '../../../services/editor/common/editorGroupColumn.js';
|
|
38
|
+
import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js';
|
|
39
|
+
import { IEditorService, SIDE_GROUP } from '../../../services/editor/common/editorService.js';
|
|
40
|
+
import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js';
|
|
41
|
+
import { IExtensionService } from '../../../services/extensions/common/extensions.js';
|
|
42
|
+
import { ILifecycleService } from '../../../services/lifecycle/common/lifecycle.js';
|
|
43
|
+
import { IRemoteAgentService } from '../../../services/remote/common/remoteAgentService.js';
|
|
44
|
+
let TerminalService = class TerminalService {
|
|
45
|
+
get isProcessSupportRegistered() { return !!this._processSupportContextKey.get(); }
|
|
46
|
+
get connectionState() { return this._connectionState; }
|
|
47
|
+
get configHelper() { return this._configHelper; }
|
|
48
|
+
get instances() {
|
|
49
|
+
return this._terminalGroupService.instances.concat(this._terminalEditorService.instances);
|
|
50
|
+
}
|
|
51
|
+
getReconnectedTerminals(reconnectionOwner) {
|
|
52
|
+
return this._reconnectedTerminals.get(reconnectionOwner);
|
|
53
|
+
}
|
|
54
|
+
get defaultLocation() { return this.configHelper.config.defaultLocation === "editor" ? TerminalLocation.Editor : TerminalLocation.Panel; }
|
|
55
|
+
get activeInstance() {
|
|
56
|
+
for (const activeHostTerminal of ( this._hostActiveTerminals.values())) {
|
|
57
|
+
if (activeHostTerminal?.hasFocus) {
|
|
58
|
+
return activeHostTerminal;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return this._activeInstance;
|
|
62
|
+
}
|
|
63
|
+
get onDidChangeActiveGroup() { return this._onDidChangeActiveGroup.event; }
|
|
64
|
+
get onDidCreateInstance() { return this._onDidCreateInstance.event; }
|
|
65
|
+
get onDidDisposeInstance() { return this._onDidDisposeInstance.event; }
|
|
66
|
+
get onDidFocusInstance() { return this._onDidFocusInstance.event; }
|
|
67
|
+
get onDidReceiveProcessId() { return this._onDidReceiveProcessId.event; }
|
|
68
|
+
get onDidRequestStartExtensionTerminal() { return this._onDidRequestStartExtensionTerminal.event; }
|
|
69
|
+
get onDidChangeInstanceDimensions() { return this._onDidChangeInstanceDimensions.event; }
|
|
70
|
+
get onDidMaximumDimensionsChange() { return this._onDidMaxiumumDimensionsChange.event; }
|
|
71
|
+
get onDidChangeInstanceCapability() { return this._onDidChangeInstanceCapability.event; }
|
|
72
|
+
get onDidChangeInstances() { return this._onDidChangeInstances.event; }
|
|
73
|
+
get onDidChangeInstanceTitle() { return this._onDidChangeInstanceTitle.event; }
|
|
74
|
+
get onDidChangeInstanceIcon() { return this._onDidChangeInstanceIcon.event; }
|
|
75
|
+
get onDidChangeInstanceColor() { return this._onDidChangeInstanceColor.event; }
|
|
76
|
+
get onDidChangeActiveInstance() { return this._onDidChangeActiveInstance.event; }
|
|
77
|
+
get onDidChangeInstancePrimaryStatus() { return this._onDidChangeInstancePrimaryStatus.event; }
|
|
78
|
+
get onDidInputInstanceData() { return this._onDidInputInstanceData.event; }
|
|
79
|
+
get onDidDisposeGroup() { return this._onDidDisposeGroup.event; }
|
|
80
|
+
get onDidChangeGroups() { return this._onDidChangeGroups.event; }
|
|
81
|
+
get onDidRegisterProcessSupport() { return this._onDidRegisterProcessSupport.event; }
|
|
82
|
+
get onDidChangeConnectionState() { return this._onDidChangeConnectionState.event; }
|
|
83
|
+
constructor(_contextKeyService, _lifecycleService, _logService, _dialogService, _instantiationService, _remoteAgentService, _viewsService, _configurationService, _environmentService, _terminalEditorService, _terminalGroupService, _terminalInstanceService, _editorGroupsService, _terminalProfileService, _extensionService, _notificationService, _workspaceContextService, _commandService) {
|
|
84
|
+
this._contextKeyService = _contextKeyService;
|
|
85
|
+
this._lifecycleService = _lifecycleService;
|
|
86
|
+
this._logService = _logService;
|
|
87
|
+
this._dialogService = _dialogService;
|
|
88
|
+
this._instantiationService = _instantiationService;
|
|
89
|
+
this._remoteAgentService = _remoteAgentService;
|
|
90
|
+
this._viewsService = _viewsService;
|
|
91
|
+
this._configurationService = _configurationService;
|
|
92
|
+
this._environmentService = _environmentService;
|
|
93
|
+
this._terminalEditorService = _terminalEditorService;
|
|
94
|
+
this._terminalGroupService = _terminalGroupService;
|
|
95
|
+
this._terminalInstanceService = _terminalInstanceService;
|
|
96
|
+
this._editorGroupsService = _editorGroupsService;
|
|
97
|
+
this._terminalProfileService = _terminalProfileService;
|
|
98
|
+
this._extensionService = _extensionService;
|
|
99
|
+
this._notificationService = _notificationService;
|
|
100
|
+
this._workspaceContextService = _workspaceContextService;
|
|
101
|
+
this._commandService = _commandService;
|
|
102
|
+
this._hostActiveTerminals = ( new Map());
|
|
103
|
+
this._escapeSequenceLoggingEnabled = false;
|
|
104
|
+
this._isShuttingDown = false;
|
|
105
|
+
this._backgroundedTerminalInstances = [];
|
|
106
|
+
this._backgroundedTerminalDisposables = ( new Map());
|
|
107
|
+
this._connectionState = 0 ;
|
|
108
|
+
this._reconnectedTerminals = ( new Map());
|
|
109
|
+
this._onDidChangeActiveGroup = ( new Emitter());
|
|
110
|
+
this._onDidCreateInstance = ( new Emitter());
|
|
111
|
+
this._onDidDisposeInstance = ( new Emitter());
|
|
112
|
+
this._onDidFocusInstance = ( new Emitter());
|
|
113
|
+
this._onDidReceiveProcessId = ( new Emitter());
|
|
114
|
+
this._onDidRequestStartExtensionTerminal = ( new Emitter());
|
|
115
|
+
this._onDidChangeInstanceDimensions = ( new Emitter());
|
|
116
|
+
this._onDidMaxiumumDimensionsChange = ( new Emitter());
|
|
117
|
+
this._onDidChangeInstanceCapability = ( new Emitter());
|
|
118
|
+
this._onDidChangeInstances = ( new Emitter());
|
|
119
|
+
this._onDidChangeInstanceTitle = ( new Emitter());
|
|
120
|
+
this._onDidChangeInstanceIcon = ( new Emitter());
|
|
121
|
+
this._onDidChangeInstanceColor = ( new Emitter());
|
|
122
|
+
this._onDidChangeActiveInstance = ( new Emitter());
|
|
123
|
+
this._onDidChangeInstancePrimaryStatus = ( new Emitter());
|
|
124
|
+
this._onDidInputInstanceData = ( new Emitter());
|
|
125
|
+
this._onDidDisposeGroup = ( new Emitter());
|
|
126
|
+
this._onDidChangeGroups = ( new Emitter());
|
|
127
|
+
this._onDidRegisterProcessSupport = ( new Emitter());
|
|
128
|
+
this._onDidChangeConnectionState = ( new Emitter());
|
|
129
|
+
this._configHelper = this._instantiationService.createInstance(TerminalConfigHelper);
|
|
130
|
+
this.onDidCreateInstance(() => this._terminalProfileService.refreshAvailableProfiles());
|
|
131
|
+
this._forwardInstanceHostEvents(this._terminalGroupService);
|
|
132
|
+
this._forwardInstanceHostEvents(this._terminalEditorService);
|
|
133
|
+
this._terminalGroupService.onDidChangeActiveGroup(this._onDidChangeActiveGroup.fire, this._onDidChangeActiveGroup);
|
|
134
|
+
this._terminalInstanceService.onDidCreateInstance(instance => {
|
|
135
|
+
instance.setEscapeSequenceLogging(this._escapeSequenceLoggingEnabled);
|
|
136
|
+
this._initInstanceListeners(instance);
|
|
137
|
+
this._onDidCreateInstance.fire(instance);
|
|
138
|
+
});
|
|
139
|
+
this._terminalGroupService.onDidChangeActiveInstance(instance => {
|
|
140
|
+
if (!instance && !this._isShuttingDown) {
|
|
141
|
+
this._terminalGroupService.hidePanel();
|
|
142
|
+
}
|
|
143
|
+
if (instance?.shellType) {
|
|
144
|
+
this._terminalShellTypeContextKey.set(( instance.shellType.toString()));
|
|
145
|
+
}
|
|
146
|
+
else if (!instance) {
|
|
147
|
+
this._terminalShellTypeContextKey.reset();
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
this._handleInstanceContextKeys();
|
|
151
|
+
this._terminalShellTypeContextKey = TerminalContextKeys.shellType.bindTo(this._contextKeyService);
|
|
152
|
+
this._processSupportContextKey = TerminalContextKeys.processSupported.bindTo(this._contextKeyService);
|
|
153
|
+
this._processSupportContextKey.set(!isWeb || this._remoteAgentService.getConnection() !== null);
|
|
154
|
+
this._terminalHasBeenCreated = TerminalContextKeys.terminalHasBeenCreated.bindTo(this._contextKeyService);
|
|
155
|
+
this._terminalCountContextKey = TerminalContextKeys.count.bindTo(this._contextKeyService);
|
|
156
|
+
this._terminalEditorActive = TerminalContextKeys.terminalEditorActive.bindTo(this._contextKeyService);
|
|
157
|
+
this.onDidChangeActiveInstance(instance => {
|
|
158
|
+
this._terminalEditorActive.set(!!instance?.target && instance.target === TerminalLocation.Editor);
|
|
159
|
+
});
|
|
160
|
+
_lifecycleService.onBeforeShutdown(async (e) => e.veto(this._onBeforeShutdown(e.reason), 'veto.terminal'));
|
|
161
|
+
_lifecycleService.onWillShutdown(e => this._onWillShutdown(e));
|
|
162
|
+
this.initializePrimaryBackend();
|
|
163
|
+
timeout(0).then(() => this._instantiationService.createInstance(TerminalEditorStyle, document.head));
|
|
164
|
+
}
|
|
165
|
+
async showProfileQuickPick(type, cwd) {
|
|
166
|
+
const quickPick = this._instantiationService.createInstance(TerminalProfileQuickpick);
|
|
167
|
+
const result = await quickPick.showAndGetResult(type);
|
|
168
|
+
if (!result) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (typeof result === 'string') {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const keyMods = result.keyMods;
|
|
175
|
+
if (type === 'createInstance') {
|
|
176
|
+
const activeInstance = this.getDefaultInstanceHost().activeInstance;
|
|
177
|
+
let instance;
|
|
178
|
+
if (result.config && 'id' in result?.config) {
|
|
179
|
+
await this.createContributedTerminalProfile(result.config.extensionIdentifier, result.config.id, {
|
|
180
|
+
icon: result.config.options?.icon,
|
|
181
|
+
color: result.config.options?.color,
|
|
182
|
+
location: !!(keyMods?.alt && activeInstance) ? { splitActiveTerminal: true } : this.defaultLocation
|
|
183
|
+
});
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
else if (result.config && 'profileName' in result.config) {
|
|
187
|
+
if (keyMods?.alt && activeInstance) {
|
|
188
|
+
instance = await this.createTerminal({ location: { parentTerminal: activeInstance }, config: result.config, cwd });
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
instance = await this.createTerminal({ location: this.defaultLocation, config: result.config, cwd });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (instance && this.defaultLocation !== TerminalLocation.Editor) {
|
|
195
|
+
this._terminalGroupService.showPanel(true);
|
|
196
|
+
this.setActiveInstance(instance);
|
|
197
|
+
return instance;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return undefined;
|
|
201
|
+
}
|
|
202
|
+
async initializePrimaryBackend() {
|
|
203
|
+
this._primaryBackend = await this._terminalInstanceService.getBackend(this._environmentService.remoteAuthority);
|
|
204
|
+
const enableTerminalReconnection = this.configHelper.config.enablePersistentSessions;
|
|
205
|
+
this._connectionState = 0 ;
|
|
206
|
+
const isPersistentRemote = !!this._environmentService.remoteAuthority && enableTerminalReconnection;
|
|
207
|
+
if (isPersistentRemote) {
|
|
208
|
+
this._reconnectToRemoteTerminals().then(() => this._setConnected());
|
|
209
|
+
}
|
|
210
|
+
else if (enableTerminalReconnection) {
|
|
211
|
+
this._reconnectToLocalTerminals().then(() => this._setConnected());
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
Promise.resolve().then(() => this._setConnected());
|
|
215
|
+
}
|
|
216
|
+
this._primaryBackend?.onDidRequestDetach(async (e) => {
|
|
217
|
+
const instanceToDetach = this.getInstanceFromResource(getTerminalUri(e.workspaceId, e.instanceId));
|
|
218
|
+
if (instanceToDetach) {
|
|
219
|
+
const persistentProcessId = instanceToDetach?.persistentProcessId;
|
|
220
|
+
if (persistentProcessId && !instanceToDetach.shellLaunchConfig.isFeatureTerminal && !instanceToDetach.shellLaunchConfig.customPtyImplementation) {
|
|
221
|
+
if (instanceToDetach.target === TerminalLocation.Editor) {
|
|
222
|
+
this._terminalEditorService.detachInstance(instanceToDetach);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
this._terminalGroupService.getGroupForInstance(instanceToDetach)?.removeInstance(instanceToDetach);
|
|
226
|
+
}
|
|
227
|
+
await instanceToDetach.detachProcessAndDispose(TerminalExitReason.User);
|
|
228
|
+
await this._primaryBackend?.acceptDetachInstanceReply(e.requestId, persistentProcessId);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
await this._primaryBackend?.acceptDetachInstanceReply(e.requestId, undefined);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
getPrimaryBackend() {
|
|
237
|
+
return this._primaryBackend;
|
|
238
|
+
}
|
|
239
|
+
_forwardInstanceHostEvents(host) {
|
|
240
|
+
host.onDidChangeInstances(this._onDidChangeInstances.fire, this._onDidChangeInstances);
|
|
241
|
+
host.onDidDisposeInstance(this._onDidDisposeInstance.fire, this._onDidDisposeInstance);
|
|
242
|
+
host.onDidChangeActiveInstance(instance => this._evaluateActiveInstance(host, instance));
|
|
243
|
+
host.onDidFocusInstance(instance => {
|
|
244
|
+
this._onDidFocusInstance.fire(instance);
|
|
245
|
+
this._evaluateActiveInstance(host, instance);
|
|
246
|
+
});
|
|
247
|
+
host.onDidChangeInstanceCapability((instance) => {
|
|
248
|
+
this._onDidChangeInstanceCapability.fire(instance);
|
|
249
|
+
});
|
|
250
|
+
this._hostActiveTerminals.set(host, undefined);
|
|
251
|
+
}
|
|
252
|
+
_evaluateActiveInstance(host, instance) {
|
|
253
|
+
this._hostActiveTerminals.set(host, instance);
|
|
254
|
+
if (instance === undefined) {
|
|
255
|
+
for (const active of ( this._hostActiveTerminals.values())) {
|
|
256
|
+
if (active) {
|
|
257
|
+
instance = active;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
this._activeInstance = instance;
|
|
262
|
+
this._onDidChangeActiveInstance.fire(instance);
|
|
263
|
+
}
|
|
264
|
+
setActiveInstance(value) {
|
|
265
|
+
if (value.shellLaunchConfig.hideFromUser) {
|
|
266
|
+
this._showBackgroundTerminal(value);
|
|
267
|
+
}
|
|
268
|
+
if (value.target === TerminalLocation.Editor) {
|
|
269
|
+
this._terminalEditorService.setActiveInstance(value);
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
this._terminalGroupService.setActiveInstance(value);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
async focusActiveInstance() {
|
|
276
|
+
if (!this._activeInstance) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (this._activeInstance.target === TerminalLocation.Editor) {
|
|
280
|
+
return this._terminalEditorService.focusActiveInstance();
|
|
281
|
+
}
|
|
282
|
+
return this._terminalGroupService.focusActiveInstance();
|
|
283
|
+
}
|
|
284
|
+
async createContributedTerminalProfile(extensionIdentifier, id, options) {
|
|
285
|
+
await this._extensionService.activateByEvent(`onTerminalProfile:${id}`);
|
|
286
|
+
const profileProvider = this._terminalProfileService.getContributedProfileProvider(extensionIdentifier, id);
|
|
287
|
+
if (!profileProvider) {
|
|
288
|
+
this._notificationService.error(`No terminal profile provider registered for id "${id}"`);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
await profileProvider.createContributedTerminalProfile(options);
|
|
293
|
+
this._terminalGroupService.setActiveInstanceByIndex(this._terminalGroupService.instances.length - 1);
|
|
294
|
+
await this._terminalGroupService.activeInstance?.focusWhenReady();
|
|
295
|
+
}
|
|
296
|
+
catch (e) {
|
|
297
|
+
this._notificationService.error(e.message);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
async safeDisposeTerminal(instance) {
|
|
301
|
+
if (instance.target !== TerminalLocation.Editor &&
|
|
302
|
+
instance.hasChildProcesses &&
|
|
303
|
+
(this.configHelper.config.confirmOnKill === 'panel' || this.configHelper.config.confirmOnKill === 'always')) {
|
|
304
|
+
const veto = await this._showTerminalCloseConfirmation(true);
|
|
305
|
+
if (veto) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return ( new Promise(r => {
|
|
310
|
+
instance.onExit(() => r());
|
|
311
|
+
instance.dispose(TerminalExitReason.User);
|
|
312
|
+
}));
|
|
313
|
+
}
|
|
314
|
+
_setConnected() {
|
|
315
|
+
this._connectionState = 1 ;
|
|
316
|
+
this._onDidChangeConnectionState.fire();
|
|
317
|
+
this._logService.trace('Reconnected to terminals');
|
|
318
|
+
}
|
|
319
|
+
async _reconnectToRemoteTerminals() {
|
|
320
|
+
const remoteAuthority = this._environmentService.remoteAuthority;
|
|
321
|
+
if (!remoteAuthority) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const backend = await this._terminalInstanceService.getBackend(remoteAuthority);
|
|
325
|
+
if (!backend) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const layoutInfo = await backend.getTerminalLayoutInfo();
|
|
329
|
+
backend.reduceConnectionGraceTime();
|
|
330
|
+
await this._recreateTerminalGroups(layoutInfo);
|
|
331
|
+
this._attachProcessLayoutListeners();
|
|
332
|
+
}
|
|
333
|
+
async _reconnectToLocalTerminals() {
|
|
334
|
+
const localBackend = await this._terminalInstanceService.getBackend();
|
|
335
|
+
if (!localBackend) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
const layoutInfo = await localBackend.getTerminalLayoutInfo();
|
|
339
|
+
if (layoutInfo && layoutInfo.tabs.length > 0) {
|
|
340
|
+
await this._recreateTerminalGroups(layoutInfo);
|
|
341
|
+
}
|
|
342
|
+
this._attachProcessLayoutListeners();
|
|
343
|
+
}
|
|
344
|
+
async _recreateTerminalGroups(layoutInfo) {
|
|
345
|
+
let reconnectCounter = 0;
|
|
346
|
+
let activeGroup;
|
|
347
|
+
if (layoutInfo) {
|
|
348
|
+
for (const groupLayout of layoutInfo.tabs) {
|
|
349
|
+
const terminalLayouts = groupLayout.terminals.filter(t => t.terminal && t.terminal.isOrphan);
|
|
350
|
+
if (terminalLayouts.length) {
|
|
351
|
+
reconnectCounter += terminalLayouts.length;
|
|
352
|
+
let terminalInstance;
|
|
353
|
+
let group;
|
|
354
|
+
for (const terminalLayout of terminalLayouts) {
|
|
355
|
+
if (this._lifecycleService.startupKind !== 3 && terminalLayout.terminal?.type === 'Task') {
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
if (!terminalInstance) {
|
|
359
|
+
terminalInstance = await this.createTerminal({
|
|
360
|
+
config: { attachPersistentProcess: terminalLayout.terminal },
|
|
361
|
+
location: TerminalLocation.Panel
|
|
362
|
+
});
|
|
363
|
+
group = this._terminalGroupService.getGroupForInstance(terminalInstance);
|
|
364
|
+
if (groupLayout.isActive) {
|
|
365
|
+
activeGroup = group;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
terminalInstance = await this.createTerminal({
|
|
370
|
+
config: { attachPersistentProcess: terminalLayout.terminal },
|
|
371
|
+
location: { parentTerminal: terminalInstance }
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
const activeInstance = this.instances.find(t => {
|
|
376
|
+
return t.shellLaunchConfig.attachPersistentProcess?.id === groupLayout.activePersistentProcessId;
|
|
377
|
+
});
|
|
378
|
+
if (activeInstance) {
|
|
379
|
+
this.setActiveInstance(activeInstance);
|
|
380
|
+
}
|
|
381
|
+
group?.resizePanes(( groupLayout.terminals.map(terminal => terminal.relativeSize)));
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (layoutInfo.tabs.length) {
|
|
385
|
+
this._terminalGroupService.activeGroup = activeGroup;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return reconnectCounter;
|
|
389
|
+
}
|
|
390
|
+
async toggleEscapeSequenceLogging() {
|
|
391
|
+
if (this.instances.length === 0) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
this._escapeSequenceLoggingEnabled = await this.instances[0].toggleEscapeSequenceLogging();
|
|
395
|
+
for (let i = 1; i < this.instances.length; i++) {
|
|
396
|
+
this.instances[i].setEscapeSequenceLogging(this._escapeSequenceLoggingEnabled);
|
|
397
|
+
}
|
|
398
|
+
await this._toggleDevTools(this._escapeSequenceLoggingEnabled);
|
|
399
|
+
}
|
|
400
|
+
_attachProcessLayoutListeners() {
|
|
401
|
+
this.onDidChangeActiveGroup(() => this._saveState());
|
|
402
|
+
this.onDidChangeActiveInstance(() => this._saveState());
|
|
403
|
+
this.onDidChangeInstances(() => this._saveState());
|
|
404
|
+
this.onDidReceiveProcessId(() => this._saveState());
|
|
405
|
+
this.onDidChangeInstanceTitle(instance => this._updateTitle(instance));
|
|
406
|
+
this.onDidChangeInstanceIcon(e => this._updateIcon(e.instance, e.userInitiated));
|
|
407
|
+
}
|
|
408
|
+
_handleInstanceContextKeys() {
|
|
409
|
+
const terminalIsOpenContext = TerminalContextKeys.isOpen.bindTo(this._contextKeyService);
|
|
410
|
+
const updateTerminalContextKeys = () => {
|
|
411
|
+
terminalIsOpenContext.set(this.instances.length > 0);
|
|
412
|
+
this._terminalCountContextKey.set(this.instances.length);
|
|
413
|
+
};
|
|
414
|
+
this.onDidChangeInstances(() => updateTerminalContextKeys());
|
|
415
|
+
}
|
|
416
|
+
async getActiveOrCreateInstance(options) {
|
|
417
|
+
const activeInstance = this.activeInstance;
|
|
418
|
+
if (!activeInstance) {
|
|
419
|
+
return this.createTerminal();
|
|
420
|
+
}
|
|
421
|
+
if (!options?.acceptsInput || activeInstance.xterm?.isStdinDisabled !== true) {
|
|
422
|
+
return activeInstance;
|
|
423
|
+
}
|
|
424
|
+
const instance = await this.createTerminal();
|
|
425
|
+
this.setActiveInstance(instance);
|
|
426
|
+
await this.revealActiveTerminal();
|
|
427
|
+
return instance;
|
|
428
|
+
}
|
|
429
|
+
async revealActiveTerminal() {
|
|
430
|
+
const instance = this.activeInstance;
|
|
431
|
+
if (!instance) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
if (instance.target === TerminalLocation.Editor) {
|
|
435
|
+
await this._terminalEditorService.revealActiveEditor();
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
await this._terminalGroupService.showPanel();
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
setEditable(instance, data) {
|
|
442
|
+
if (!data) {
|
|
443
|
+
this._editable = undefined;
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
this._editable = { instance: instance, data };
|
|
447
|
+
}
|
|
448
|
+
const pane = this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID);
|
|
449
|
+
const isEditing = this.isEditable(instance);
|
|
450
|
+
pane?.terminalTabbedView?.setEditable(isEditing);
|
|
451
|
+
}
|
|
452
|
+
isEditable(instance) {
|
|
453
|
+
return !!this._editable && (this._editable.instance === instance || !instance);
|
|
454
|
+
}
|
|
455
|
+
getEditableData(instance) {
|
|
456
|
+
return this._editable && this._editable.instance === instance ? this._editable.data : undefined;
|
|
457
|
+
}
|
|
458
|
+
requestStartExtensionTerminal(proxy, cols, rows) {
|
|
459
|
+
return ( new Promise(callback => {
|
|
460
|
+
this._onDidRequestStartExtensionTerminal.fire({ proxy, cols, rows, callback });
|
|
461
|
+
}));
|
|
462
|
+
}
|
|
463
|
+
_onBeforeShutdown(reason) {
|
|
464
|
+
if (isWeb) {
|
|
465
|
+
this._isShuttingDown = true;
|
|
466
|
+
return false;
|
|
467
|
+
}
|
|
468
|
+
return this._onBeforeShutdownAsync(reason);
|
|
469
|
+
}
|
|
470
|
+
async _onBeforeShutdownAsync(reason) {
|
|
471
|
+
if (this.instances.length === 0) {
|
|
472
|
+
return false;
|
|
473
|
+
}
|
|
474
|
+
try {
|
|
475
|
+
this._shutdownWindowCount = await this._nativeDelegate?.getWindowCount();
|
|
476
|
+
const shouldReviveProcesses = this._shouldReviveProcesses(reason);
|
|
477
|
+
if (shouldReviveProcesses) {
|
|
478
|
+
await Promise.race([
|
|
479
|
+
this._primaryBackend?.persistTerminalState(),
|
|
480
|
+
timeout(2000)
|
|
481
|
+
]);
|
|
482
|
+
}
|
|
483
|
+
const shouldPersistProcesses = this._configHelper.config.enablePersistentSessions && reason === 3 ;
|
|
484
|
+
if (!shouldPersistProcesses) {
|
|
485
|
+
const hasDirtyInstances = ((this.configHelper.config.confirmOnExit === 'always' && this.instances.length > 0) ||
|
|
486
|
+
(this.configHelper.config.confirmOnExit === 'hasChildProcesses' && ( this.instances.some(e => e.hasChildProcesses))));
|
|
487
|
+
if (hasDirtyInstances) {
|
|
488
|
+
return this._onBeforeShutdownConfirmation(reason);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
catch (err) {
|
|
493
|
+
this._logService.warn('Exception occurred during terminal shutdown', err);
|
|
494
|
+
}
|
|
495
|
+
this._isShuttingDown = true;
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
498
|
+
setNativeDelegate(nativeDelegate) {
|
|
499
|
+
this._nativeDelegate = nativeDelegate;
|
|
500
|
+
}
|
|
501
|
+
async _toggleDevTools(open) {
|
|
502
|
+
if (open) {
|
|
503
|
+
this._nativeDelegate?.openDevTools();
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
this._nativeDelegate?.toggleDevTools();
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
_shouldReviveProcesses(reason) {
|
|
510
|
+
if (!this._configHelper.config.enablePersistentSessions) {
|
|
511
|
+
return false;
|
|
512
|
+
}
|
|
513
|
+
switch (this.configHelper.config.persistentSessionReviveProcess) {
|
|
514
|
+
case 'onExit': {
|
|
515
|
+
if (reason === 1 && (this._shutdownWindowCount === 1 && !isMacintosh)) {
|
|
516
|
+
return true;
|
|
517
|
+
}
|
|
518
|
+
return reason === 4 || reason === 2 ;
|
|
519
|
+
}
|
|
520
|
+
case 'onExitAndWindowClose': return reason !== 3 ;
|
|
521
|
+
default: return false;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
async _onBeforeShutdownConfirmation(reason) {
|
|
525
|
+
const veto = await this._showTerminalCloseConfirmation();
|
|
526
|
+
if (!veto) {
|
|
527
|
+
this._isShuttingDown = true;
|
|
528
|
+
}
|
|
529
|
+
return veto;
|
|
530
|
+
}
|
|
531
|
+
_onWillShutdown(e) {
|
|
532
|
+
const shouldPersistTerminals = this._configHelper.config.enablePersistentSessions && e.reason === 3 ;
|
|
533
|
+
for (const instance of [...this._terminalGroupService.instances, ...this._backgroundedTerminalInstances]) {
|
|
534
|
+
if (shouldPersistTerminals && instance.shouldPersist) {
|
|
535
|
+
instance.detachProcessAndDispose(TerminalExitReason.Shutdown);
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
instance.dispose(TerminalExitReason.Shutdown);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
if (!shouldPersistTerminals && !this._shouldReviveProcesses(e.reason)) {
|
|
542
|
+
this._primaryBackend?.setTerminalLayoutInfo(undefined);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
_saveState() {
|
|
546
|
+
if (this._isShuttingDown) {
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
if (!this.configHelper.config.enablePersistentSessions) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
const tabs = ( this._terminalGroupService.groups.map(g => g.getLayoutInfo(g === this._terminalGroupService.activeGroup)));
|
|
553
|
+
const state = { tabs };
|
|
554
|
+
this._primaryBackend?.setTerminalLayoutInfo(state);
|
|
555
|
+
}
|
|
556
|
+
_updateTitle(instance) {
|
|
557
|
+
if (!this.configHelper.config.enablePersistentSessions || !instance || !instance.persistentProcessId || !instance.title || instance.isDisposed) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
if (instance.staticTitle) {
|
|
561
|
+
this._primaryBackend?.updateTitle(instance.persistentProcessId, instance.staticTitle, TitleEventSource.Api);
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
this._primaryBackend?.updateTitle(instance.persistentProcessId, instance.title, instance.titleSource);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
_updateIcon(instance, userInitiated) {
|
|
568
|
+
if (!this.configHelper.config.enablePersistentSessions || !instance || !instance.persistentProcessId || !instance.icon || instance.isDisposed) {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
this._primaryBackend?.updateIcon(instance.persistentProcessId, userInitiated, instance.icon, instance.color);
|
|
572
|
+
}
|
|
573
|
+
refreshActiveGroup() {
|
|
574
|
+
this._onDidChangeActiveGroup.fire(this._terminalGroupService.activeGroup);
|
|
575
|
+
}
|
|
576
|
+
getInstanceFromId(terminalId) {
|
|
577
|
+
let bgIndex = -1;
|
|
578
|
+
this._backgroundedTerminalInstances.forEach((terminalInstance, i) => {
|
|
579
|
+
if (terminalInstance.instanceId === terminalId) {
|
|
580
|
+
bgIndex = i;
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
if (bgIndex !== -1) {
|
|
584
|
+
return this._backgroundedTerminalInstances[bgIndex];
|
|
585
|
+
}
|
|
586
|
+
try {
|
|
587
|
+
return this.instances[this._getIndexFromId(terminalId)];
|
|
588
|
+
}
|
|
589
|
+
catch {
|
|
590
|
+
return undefined;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
getInstanceFromIndex(terminalIndex) {
|
|
594
|
+
return this.instances[terminalIndex];
|
|
595
|
+
}
|
|
596
|
+
getInstanceFromResource(resource) {
|
|
597
|
+
return getInstanceFromResource(this.instances, resource);
|
|
598
|
+
}
|
|
599
|
+
isAttachedToTerminal(remoteTerm) {
|
|
600
|
+
return ( this.instances.some(term => term.processId === remoteTerm.pid));
|
|
601
|
+
}
|
|
602
|
+
moveToEditor(source) {
|
|
603
|
+
if (source.target === TerminalLocation.Editor) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
const sourceGroup = this._terminalGroupService.getGroupForInstance(source);
|
|
607
|
+
if (!sourceGroup) {
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
sourceGroup.removeInstance(source);
|
|
611
|
+
this._terminalEditorService.openEditor(source);
|
|
612
|
+
}
|
|
613
|
+
async moveToTerminalView(source, target, side) {
|
|
614
|
+
if (URI.isUri(source)) {
|
|
615
|
+
source = this.getInstanceFromResource(source);
|
|
616
|
+
}
|
|
617
|
+
if (!source) {
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
this._terminalEditorService.detachInstance(source);
|
|
621
|
+
if (source.target !== TerminalLocation.Editor) {
|
|
622
|
+
await this._terminalGroupService.showPanel(true);
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
source.target = TerminalLocation.Panel;
|
|
626
|
+
let group;
|
|
627
|
+
if (target) {
|
|
628
|
+
group = this._terminalGroupService.getGroupForInstance(target);
|
|
629
|
+
}
|
|
630
|
+
if (!group) {
|
|
631
|
+
group = this._terminalGroupService.createGroup();
|
|
632
|
+
}
|
|
633
|
+
group.addInstance(source);
|
|
634
|
+
this.setActiveInstance(source);
|
|
635
|
+
await this._terminalGroupService.showPanel(true);
|
|
636
|
+
if (target && side) {
|
|
637
|
+
const index = group.terminalInstances.indexOf(target) + (side === 'after' ? 1 : 0);
|
|
638
|
+
group.moveInstance(source, index);
|
|
639
|
+
}
|
|
640
|
+
this._onDidChangeInstances.fire();
|
|
641
|
+
this._onDidChangeActiveGroup.fire(this._terminalGroupService.activeGroup);
|
|
642
|
+
}
|
|
643
|
+
_initInstanceListeners(instance) {
|
|
644
|
+
const instanceDisposables = [
|
|
645
|
+
instance.onTitleChanged(this._onDidChangeInstanceTitle.fire, this._onDidChangeInstanceTitle),
|
|
646
|
+
instance.onIconChanged(this._onDidChangeInstanceIcon.fire, this._onDidChangeInstanceIcon),
|
|
647
|
+
instance.onIconChanged(this._onDidChangeInstanceColor.fire, this._onDidChangeInstanceColor),
|
|
648
|
+
instance.onProcessIdReady(this._onDidReceiveProcessId.fire, this._onDidReceiveProcessId),
|
|
649
|
+
instance.statusList.onDidChangePrimaryStatus(() => this._onDidChangeInstancePrimaryStatus.fire(instance)),
|
|
650
|
+
instance.onDimensionsChanged(() => {
|
|
651
|
+
this._onDidChangeInstanceDimensions.fire(instance);
|
|
652
|
+
if (this.configHelper.config.enablePersistentSessions && this.isProcessSupportRegistered) {
|
|
653
|
+
this._saveState();
|
|
654
|
+
}
|
|
655
|
+
}),
|
|
656
|
+
instance.onMaximumDimensionsChanged(() => this._onDidMaxiumumDimensionsChange.fire(instance)),
|
|
657
|
+
instance.onDidInputData(this._onDidInputInstanceData.fire, this._onDidInputInstanceData),
|
|
658
|
+
instance.onDidFocus(this._onDidChangeActiveInstance.fire, this._onDidChangeActiveInstance),
|
|
659
|
+
instance.onRequestAddInstanceToGroup(async (e) => await this._addInstanceToGroup(instance, e))
|
|
660
|
+
];
|
|
661
|
+
instance.onDisposed(() => dispose(instanceDisposables));
|
|
662
|
+
}
|
|
663
|
+
async _addInstanceToGroup(instance, e) {
|
|
664
|
+
const terminalIdentifier = parseTerminalUri(e.uri);
|
|
665
|
+
if (terminalIdentifier.instanceId === undefined) {
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
let sourceInstance = this.getInstanceFromResource(e.uri);
|
|
669
|
+
if (!sourceInstance) {
|
|
670
|
+
const attachPersistentProcess = await this._primaryBackend?.requestDetachInstance(terminalIdentifier.workspaceId, terminalIdentifier.instanceId);
|
|
671
|
+
if (attachPersistentProcess) {
|
|
672
|
+
sourceInstance = await this.createTerminal({ config: { attachPersistentProcess }, resource: e.uri });
|
|
673
|
+
this._terminalGroupService.moveInstance(sourceInstance, instance, e.side);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
sourceInstance = this._terminalGroupService.getInstanceFromResource(e.uri);
|
|
678
|
+
if (sourceInstance) {
|
|
679
|
+
this._terminalGroupService.moveInstance(sourceInstance, instance, e.side);
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
sourceInstance = this._terminalEditorService.getInstanceFromResource(e.uri);
|
|
683
|
+
if (sourceInstance) {
|
|
684
|
+
this.moveToTerminalView(sourceInstance, instance, e.side);
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
registerProcessSupport(isSupported) {
|
|
690
|
+
if (!isSupported) {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
this._processSupportContextKey.set(isSupported);
|
|
694
|
+
this._onDidRegisterProcessSupport.fire();
|
|
695
|
+
}
|
|
696
|
+
_getIndexFromId(terminalId) {
|
|
697
|
+
let terminalIndex = -1;
|
|
698
|
+
this.instances.forEach((terminalInstance, i) => {
|
|
699
|
+
if (terminalInstance.instanceId === terminalId) {
|
|
700
|
+
terminalIndex = i;
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
if (terminalIndex === -1) {
|
|
704
|
+
throw new Error(`Terminal with ID ${terminalId} does not exist (has it already been disposed?)`);
|
|
705
|
+
}
|
|
706
|
+
return terminalIndex;
|
|
707
|
+
}
|
|
708
|
+
async _showTerminalCloseConfirmation(singleTerminal) {
|
|
709
|
+
let message;
|
|
710
|
+
if (this.instances.length === 1 || singleTerminal) {
|
|
711
|
+
message = ( nls.localize(
|
|
712
|
+
'terminalService.terminalCloseConfirmationSingular',
|
|
713
|
+
"Do you want to terminate the active terminal session?"
|
|
714
|
+
));
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
message = ( nls.localize(
|
|
718
|
+
'terminalService.terminalCloseConfirmationPlural',
|
|
719
|
+
"Do you want to terminate the {0} active terminal sessions?",
|
|
720
|
+
this.instances.length
|
|
721
|
+
));
|
|
722
|
+
}
|
|
723
|
+
const { confirmed } = await this._dialogService.confirm({
|
|
724
|
+
type: 'warning',
|
|
725
|
+
message,
|
|
726
|
+
primaryButton: ( nls.localize({ key: 'terminate', comment: ['&& denotes a mnemonic'] }, "&&Terminate"))
|
|
727
|
+
});
|
|
728
|
+
return !confirmed;
|
|
729
|
+
}
|
|
730
|
+
getDefaultInstanceHost() {
|
|
731
|
+
if (this.defaultLocation === TerminalLocation.Editor) {
|
|
732
|
+
return this._terminalEditorService;
|
|
733
|
+
}
|
|
734
|
+
return this._terminalGroupService;
|
|
735
|
+
}
|
|
736
|
+
getInstanceHost(location) {
|
|
737
|
+
if (location) {
|
|
738
|
+
if (location === TerminalLocation.Editor) {
|
|
739
|
+
return this._terminalEditorService;
|
|
740
|
+
}
|
|
741
|
+
else if (typeof location === 'object') {
|
|
742
|
+
if ('viewColumn' in location) {
|
|
743
|
+
return this._terminalEditorService;
|
|
744
|
+
}
|
|
745
|
+
else if ('parentTerminal' in location) {
|
|
746
|
+
return location.parentTerminal.target === TerminalLocation.Editor ? this._terminalEditorService : this._terminalGroupService;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
else {
|
|
750
|
+
return this._terminalGroupService;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
return this;
|
|
754
|
+
}
|
|
755
|
+
async createTerminal(options) {
|
|
756
|
+
if (this._terminalProfileService.availableProfiles.length === 0) {
|
|
757
|
+
const isPtyTerminal = options?.config && 'customPtyImplementation' in options.config;
|
|
758
|
+
const isLocalInRemoteTerminal = this._remoteAgentService.getConnection() && URI.isUri(options?.cwd) && options?.cwd.scheme === Schemas.vscodeFileResource;
|
|
759
|
+
if (!isPtyTerminal && !isLocalInRemoteTerminal) {
|
|
760
|
+
await this._terminalProfileService.profilesReady;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
const config = options?.config || this._terminalProfileService.getDefaultProfile();
|
|
764
|
+
const shellLaunchConfig = config && 'extensionIdentifier' in config ? {} : this._terminalInstanceService.convertProfileToShellLaunchConfig(config || {});
|
|
765
|
+
let contributedProfile = config && 'extensionIdentifier' in config ? config : undefined;
|
|
766
|
+
if (!contributedProfile && (!options || !options.config)) {
|
|
767
|
+
contributedProfile = await this._terminalProfileService.getContributedDefaultProfile(shellLaunchConfig);
|
|
768
|
+
}
|
|
769
|
+
const splitActiveTerminal = typeof options?.location === 'object' && 'splitActiveTerminal' in options.location ? options.location.splitActiveTerminal : typeof options?.location === 'object' ? 'parentTerminal' in options.location : false;
|
|
770
|
+
await this._resolveCwd(shellLaunchConfig, splitActiveTerminal, options);
|
|
771
|
+
if (contributedProfile) {
|
|
772
|
+
const resolvedLocation = this.resolveLocation(options?.location);
|
|
773
|
+
let location;
|
|
774
|
+
if (splitActiveTerminal) {
|
|
775
|
+
location = resolvedLocation === TerminalLocation.Editor ? { viewColumn: SIDE_GROUP } : { splitActiveTerminal: true };
|
|
776
|
+
}
|
|
777
|
+
else {
|
|
778
|
+
location = typeof options?.location === 'object' && 'viewColumn' in options.location ? options.location : resolvedLocation;
|
|
779
|
+
}
|
|
780
|
+
await this.createContributedTerminalProfile(contributedProfile.extensionIdentifier, contributedProfile.id, {
|
|
781
|
+
icon: contributedProfile.icon,
|
|
782
|
+
color: contributedProfile.color,
|
|
783
|
+
location
|
|
784
|
+
});
|
|
785
|
+
const instanceHost = resolvedLocation === TerminalLocation.Editor ? this._terminalEditorService : this._terminalGroupService;
|
|
786
|
+
const instance = instanceHost.instances[instanceHost.instances.length - 1];
|
|
787
|
+
await instance.focusWhenReady();
|
|
788
|
+
this._terminalHasBeenCreated.set(true);
|
|
789
|
+
return instance;
|
|
790
|
+
}
|
|
791
|
+
if (!shellLaunchConfig.customPtyImplementation && !this.isProcessSupportRegistered) {
|
|
792
|
+
throw new Error('Could not create terminal when process support is not registered');
|
|
793
|
+
}
|
|
794
|
+
if (shellLaunchConfig.hideFromUser) {
|
|
795
|
+
const instance = this._terminalInstanceService.createInstance(shellLaunchConfig, TerminalLocation.Panel);
|
|
796
|
+
this._backgroundedTerminalInstances.push(instance);
|
|
797
|
+
this._backgroundedTerminalDisposables.set(instance.instanceId, [
|
|
798
|
+
instance.onDisposed(this._onDidDisposeInstance.fire, this._onDidDisposeInstance)
|
|
799
|
+
]);
|
|
800
|
+
this._terminalHasBeenCreated.set(true);
|
|
801
|
+
return instance;
|
|
802
|
+
}
|
|
803
|
+
this._evaluateLocalCwd(shellLaunchConfig);
|
|
804
|
+
const location = this.resolveLocation(options?.location) || this.defaultLocation;
|
|
805
|
+
const parent = this._getSplitParent(options?.location);
|
|
806
|
+
this._terminalHasBeenCreated.set(true);
|
|
807
|
+
if (parent) {
|
|
808
|
+
return this._splitTerminal(shellLaunchConfig, location, parent);
|
|
809
|
+
}
|
|
810
|
+
return this._createTerminal(shellLaunchConfig, location, options);
|
|
811
|
+
}
|
|
812
|
+
async _resolveCwd(shellLaunchConfig, splitActiveTerminal, options) {
|
|
813
|
+
const cwd = shellLaunchConfig.cwd;
|
|
814
|
+
if (!cwd) {
|
|
815
|
+
if (options?.cwd) {
|
|
816
|
+
shellLaunchConfig.cwd = options.cwd;
|
|
817
|
+
}
|
|
818
|
+
else if (splitActiveTerminal && options?.location) {
|
|
819
|
+
let parent = this.activeInstance;
|
|
820
|
+
if (typeof options.location === 'object' && 'parentTerminal' in options.location) {
|
|
821
|
+
parent = options.location.parentTerminal;
|
|
822
|
+
}
|
|
823
|
+
if (!parent) {
|
|
824
|
+
throw new Error('Cannot split without an active instance');
|
|
825
|
+
}
|
|
826
|
+
shellLaunchConfig.cwd = await getCwdForSplit(this.configHelper, parent, this._workspaceContextService.getWorkspace().folders, this._commandService);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
_splitTerminal(shellLaunchConfig, location, parent) {
|
|
831
|
+
let instance;
|
|
832
|
+
if (typeof shellLaunchConfig.cwd !== 'object' && typeof parent.shellLaunchConfig.cwd === 'object') {
|
|
833
|
+
shellLaunchConfig.cwd = ( URI.from({
|
|
834
|
+
scheme: parent.shellLaunchConfig.cwd.scheme,
|
|
835
|
+
authority: parent.shellLaunchConfig.cwd.authority,
|
|
836
|
+
path: shellLaunchConfig.cwd || parent.shellLaunchConfig.cwd.path
|
|
837
|
+
}));
|
|
838
|
+
}
|
|
839
|
+
if (location === TerminalLocation.Editor || parent.target === TerminalLocation.Editor) {
|
|
840
|
+
instance = this._terminalEditorService.splitInstance(parent, shellLaunchConfig);
|
|
841
|
+
}
|
|
842
|
+
else {
|
|
843
|
+
const group = this._terminalGroupService.getGroupForInstance(parent);
|
|
844
|
+
if (!group) {
|
|
845
|
+
throw new Error(`Cannot split a terminal without a group ${parent}`);
|
|
846
|
+
}
|
|
847
|
+
shellLaunchConfig.parentTerminalId = parent.instanceId;
|
|
848
|
+
instance = group.split(shellLaunchConfig);
|
|
849
|
+
}
|
|
850
|
+
this._addToReconnected(instance);
|
|
851
|
+
return instance;
|
|
852
|
+
}
|
|
853
|
+
_addToReconnected(instance) {
|
|
854
|
+
if (!instance.reconnectionProperties?.ownerId) {
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
const reconnectedTerminals = this._reconnectedTerminals.get(instance.reconnectionProperties.ownerId);
|
|
858
|
+
if (reconnectedTerminals) {
|
|
859
|
+
reconnectedTerminals.push(instance);
|
|
860
|
+
}
|
|
861
|
+
else {
|
|
862
|
+
this._reconnectedTerminals.set(instance.reconnectionProperties.ownerId, [instance]);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
_createTerminal(shellLaunchConfig, location, options) {
|
|
866
|
+
let instance;
|
|
867
|
+
const editorOptions = this._getEditorOptions(options?.location);
|
|
868
|
+
if (location === TerminalLocation.Editor) {
|
|
869
|
+
instance = this._terminalInstanceService.createInstance(shellLaunchConfig, TerminalLocation.Editor);
|
|
870
|
+
this._terminalEditorService.openEditor(instance, editorOptions);
|
|
871
|
+
}
|
|
872
|
+
else {
|
|
873
|
+
const group = this._terminalGroupService.createGroup(shellLaunchConfig);
|
|
874
|
+
instance = group.terminalInstances[0];
|
|
875
|
+
}
|
|
876
|
+
this._addToReconnected(instance);
|
|
877
|
+
return instance;
|
|
878
|
+
}
|
|
879
|
+
resolveLocation(location) {
|
|
880
|
+
if (location && typeof location === 'object') {
|
|
881
|
+
if ('parentTerminal' in location) {
|
|
882
|
+
return !location.parentTerminal.target ? TerminalLocation.Panel : location.parentTerminal.target;
|
|
883
|
+
}
|
|
884
|
+
else if ('viewColumn' in location) {
|
|
885
|
+
return TerminalLocation.Editor;
|
|
886
|
+
}
|
|
887
|
+
else if ('splitActiveTerminal' in location) {
|
|
888
|
+
return !this._activeInstance?.target ? TerminalLocation.Panel : this._activeInstance?.target;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
return location;
|
|
892
|
+
}
|
|
893
|
+
_getSplitParent(location) {
|
|
894
|
+
if (location && typeof location === 'object' && 'parentTerminal' in location) {
|
|
895
|
+
return location.parentTerminal;
|
|
896
|
+
}
|
|
897
|
+
else if (location && typeof location === 'object' && 'splitActiveTerminal' in location) {
|
|
898
|
+
return this.activeInstance;
|
|
899
|
+
}
|
|
900
|
+
return undefined;
|
|
901
|
+
}
|
|
902
|
+
_getEditorOptions(location) {
|
|
903
|
+
if (location && typeof location === 'object' && 'viewColumn' in location) {
|
|
904
|
+
location.viewColumn = columnToEditorGroup(this._editorGroupsService, this._configurationService, location.viewColumn);
|
|
905
|
+
return location;
|
|
906
|
+
}
|
|
907
|
+
return undefined;
|
|
908
|
+
}
|
|
909
|
+
_evaluateLocalCwd(shellLaunchConfig) {
|
|
910
|
+
if (typeof shellLaunchConfig.cwd !== 'string' && shellLaunchConfig.cwd?.scheme === Schemas.file) {
|
|
911
|
+
if (VirtualWorkspaceContext.getValue(this._contextKeyService)) {
|
|
912
|
+
shellLaunchConfig.initialText = formatMessageForTerminal(( nls.localize(
|
|
913
|
+
'localTerminalVirtualWorkspace',
|
|
914
|
+
"This shell is open to a {0}local{1} folder, NOT to the virtual folder",
|
|
915
|
+
'\x1b[3m',
|
|
916
|
+
'\x1b[23m'
|
|
917
|
+
)), { excludeLeadingNewLine: true, loudFormatting: true });
|
|
918
|
+
shellLaunchConfig.type = 'Local';
|
|
919
|
+
}
|
|
920
|
+
else if (this._remoteAgentService.getConnection()) {
|
|
921
|
+
shellLaunchConfig.initialText = formatMessageForTerminal(( nls.localize(
|
|
922
|
+
'localTerminalRemote',
|
|
923
|
+
"This shell is running on your {0}local{1} machine, NOT on the connected remote machine",
|
|
924
|
+
'\x1b[3m',
|
|
925
|
+
'\x1b[23m'
|
|
926
|
+
)), { excludeLeadingNewLine: true, loudFormatting: true });
|
|
927
|
+
shellLaunchConfig.type = 'Local';
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
_showBackgroundTerminal(instance) {
|
|
932
|
+
this._backgroundedTerminalInstances.splice(this._backgroundedTerminalInstances.indexOf(instance), 1);
|
|
933
|
+
const disposables = this._backgroundedTerminalDisposables.get(instance.instanceId);
|
|
934
|
+
if (disposables) {
|
|
935
|
+
dispose(disposables);
|
|
936
|
+
}
|
|
937
|
+
this._backgroundedTerminalDisposables.delete(instance.instanceId);
|
|
938
|
+
instance.shellLaunchConfig.hideFromUser = false;
|
|
939
|
+
this._terminalGroupService.createGroup(instance);
|
|
940
|
+
if (this.instances.length === 1) {
|
|
941
|
+
this._terminalGroupService.setActiveInstanceByIndex(0);
|
|
942
|
+
}
|
|
943
|
+
this._onDidChangeInstances.fire();
|
|
944
|
+
this._onDidChangeGroups.fire();
|
|
945
|
+
}
|
|
946
|
+
async setContainers(panelContainer, terminalContainer) {
|
|
947
|
+
this._configHelper.panelContainer = panelContainer;
|
|
948
|
+
this._terminalGroupService.setContainer(terminalContainer);
|
|
949
|
+
}
|
|
950
|
+
getEditingTerminal() {
|
|
951
|
+
return this._editingTerminal;
|
|
952
|
+
}
|
|
953
|
+
setEditingTerminal(instance) {
|
|
954
|
+
this._editingTerminal = instance;
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
TerminalService.__decorator = ( __decorate([
|
|
958
|
+
debounce(500)
|
|
959
|
+
], TerminalService.prototype, "_saveState", null));
|
|
960
|
+
TerminalService.__decorator = ( __decorate([
|
|
961
|
+
debounce(500)
|
|
962
|
+
], TerminalService.prototype, "_updateTitle", null));
|
|
963
|
+
TerminalService.__decorator = ( __decorate([
|
|
964
|
+
debounce(500)
|
|
965
|
+
], TerminalService.prototype, "_updateIcon", null));
|
|
966
|
+
TerminalService = ( __decorate([
|
|
967
|
+
( __param(0, IContextKeyService)),
|
|
968
|
+
( __param(1, ILifecycleService)),
|
|
969
|
+
( __param(2, ILogService)),
|
|
970
|
+
( __param(3, IDialogService)),
|
|
971
|
+
( __param(4, IInstantiationService)),
|
|
972
|
+
( __param(5, IRemoteAgentService)),
|
|
973
|
+
( __param(6, IViewsService)),
|
|
974
|
+
( __param(7, IConfigurationService)),
|
|
975
|
+
( __param(8, IWorkbenchEnvironmentService)),
|
|
976
|
+
( __param(9, ITerminalEditorService)),
|
|
977
|
+
( __param(10, ITerminalGroupService)),
|
|
978
|
+
( __param(11, ITerminalInstanceService)),
|
|
979
|
+
( __param(12, IEditorGroupsService)),
|
|
980
|
+
( __param(13, ITerminalProfileService)),
|
|
981
|
+
( __param(14, IExtensionService)),
|
|
982
|
+
( __param(15, INotificationService)),
|
|
983
|
+
( __param(16, IWorkspaceContextService)),
|
|
984
|
+
( __param(17, ICommandService))
|
|
985
|
+
], TerminalService));
|
|
986
|
+
let TerminalEditorStyle = class TerminalEditorStyle extends Themable {
|
|
987
|
+
constructor(container, _terminalService, _themeService, _terminalProfileService, _editorService) {
|
|
988
|
+
super(_themeService);
|
|
989
|
+
this._terminalService = _terminalService;
|
|
990
|
+
this._themeService = _themeService;
|
|
991
|
+
this._terminalProfileService = _terminalProfileService;
|
|
992
|
+
this._editorService = _editorService;
|
|
993
|
+
this._registerListeners();
|
|
994
|
+
this._styleElement = document.createElement('style');
|
|
995
|
+
container.appendChild(this._styleElement);
|
|
996
|
+
this._register(toDisposable(() => container.removeChild(this._styleElement)));
|
|
997
|
+
this.updateStyles();
|
|
998
|
+
}
|
|
999
|
+
_registerListeners() {
|
|
1000
|
+
this._register(this._terminalService.onDidChangeInstanceIcon(() => this.updateStyles()));
|
|
1001
|
+
this._register(this._terminalService.onDidChangeInstanceColor(() => this.updateStyles()));
|
|
1002
|
+
this._register(this._terminalService.onDidCreateInstance(() => this.updateStyles()));
|
|
1003
|
+
this._register(this._editorService.onDidActiveEditorChange(() => {
|
|
1004
|
+
if (this._editorService.activeEditor instanceof TerminalEditorInput) {
|
|
1005
|
+
this.updateStyles();
|
|
1006
|
+
}
|
|
1007
|
+
}));
|
|
1008
|
+
this._register(this._editorService.onDidCloseEditor(() => {
|
|
1009
|
+
if (this._editorService.activeEditor instanceof TerminalEditorInput) {
|
|
1010
|
+
this.updateStyles();
|
|
1011
|
+
}
|
|
1012
|
+
}));
|
|
1013
|
+
this._register(this._terminalProfileService.onDidChangeAvailableProfiles(() => this.updateStyles()));
|
|
1014
|
+
}
|
|
1015
|
+
updateStyles() {
|
|
1016
|
+
super.updateStyles();
|
|
1017
|
+
const colorTheme = this._themeService.getColorTheme();
|
|
1018
|
+
let css = '';
|
|
1019
|
+
const productIconTheme = this._themeService.getProductIconTheme();
|
|
1020
|
+
for (const instance of this._terminalService.instances) {
|
|
1021
|
+
const icon = instance.icon;
|
|
1022
|
+
if (!icon) {
|
|
1023
|
+
continue;
|
|
1024
|
+
}
|
|
1025
|
+
let uri = undefined;
|
|
1026
|
+
if (icon instanceof URI) {
|
|
1027
|
+
uri = icon;
|
|
1028
|
+
}
|
|
1029
|
+
else if (icon instanceof Object && 'light' in icon && 'dark' in icon) {
|
|
1030
|
+
uri = colorTheme.type === ColorScheme.LIGHT ? icon.light : icon.dark;
|
|
1031
|
+
}
|
|
1032
|
+
const iconClasses = getUriClasses(instance, colorTheme.type);
|
|
1033
|
+
if (uri instanceof URI && iconClasses && iconClasses.length > 1) {
|
|
1034
|
+
css += (`.monaco-workbench .terminal-tab.${iconClasses[0]}::before` +
|
|
1035
|
+
`{background-image: ${dom.asCSSUrl(uri)};}`);
|
|
1036
|
+
}
|
|
1037
|
+
if (ThemeIcon.isThemeIcon(icon)) {
|
|
1038
|
+
const iconRegistry = getIconRegistry();
|
|
1039
|
+
const iconContribution = iconRegistry.getIcon(icon.id);
|
|
1040
|
+
if (iconContribution) {
|
|
1041
|
+
const def = productIconTheme.getIcon(iconContribution);
|
|
1042
|
+
if (def) {
|
|
1043
|
+
css += (`.monaco-workbench .terminal-tab.codicon-${icon.id}::before` +
|
|
1044
|
+
`{content: '${def.fontCharacter}' !important; font-family: ${dom.asCSSPropertyValue(def.font?.id ?? 'codicon')} !important;}`);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
const iconForegroundColor = colorTheme.getColor(iconForeground);
|
|
1050
|
+
if (iconForegroundColor) {
|
|
1051
|
+
css += `.monaco-workbench .show-file-icons .file-icon.terminal-tab::before { color: ${iconForegroundColor}; }`;
|
|
1052
|
+
}
|
|
1053
|
+
css += getColorStyleContent(colorTheme, true);
|
|
1054
|
+
this._styleElement.textContent = css;
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
TerminalEditorStyle = ( __decorate([
|
|
1058
|
+
( __param(1, ITerminalService)),
|
|
1059
|
+
( __param(2, IThemeService)),
|
|
1060
|
+
( __param(3, ITerminalProfileService)),
|
|
1061
|
+
( __param(4, IEditorService))
|
|
1062
|
+
], TerminalEditorStyle));
|
|
1063
|
+
export { TerminalService };
|