@codingame/monaco-vscode-api 1.83.15 → 1.85.0-next.0
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 +430 -0
- package/api.js +13 -7
- package/assets/clear.mp3 +0 -0
- package/assets/format.mp3 +0 -0
- package/assets/save.mp3 +0 -0
- package/contributions.js +3 -0
- package/extensions.d.ts +13 -3
- package/external/{xterm-addon-image/typings/xterm-addon-image.d.ts → @xterm/addon-image/typings/addon-image.d.ts} +1 -1
- package/external/{xterm → @xterm/xterm}/typings/xterm.d.ts +13 -1
- package/lifecycle.js +2 -2
- package/localExtensionHost.js +6 -3
- package/missing-services.js +170 -22
- package/monaco-editor-treemending.patch +6884 -18018
- package/monaco-treemending.js +2 -2
- package/package.json +7 -7
- package/service-override/tools/editor.d.ts +8 -8
- package/service-override/tools/editor.js +44 -19
- package/services.d.ts +2 -2
- package/services.js +3 -3
- package/vscode/src/vs/base/browser/broadcast.js +6 -5
- package/vscode/src/vs/base/browser/dnd.d.ts +6 -0
- package/vscode/src/vs/base/browser/mouseEvent.d.ts +1 -1
- package/vscode/src/vs/base/browser/touch.d.ts +10 -0
- package/vscode/src/vs/base/browser/ui/actionbar/actionbar.d.ts +1 -0
- package/vscode/src/vs/base/browser/ui/iconLabel/iconHoverDelegate.d.ts +22 -15
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +4 -3
- package/vscode/src/vs/base/browser/ui/splitview/paneview.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/paneview.d.ts +3 -0
- package/vscode/src/vs/base/browser/ui/splitview/paneview.js +34 -11
- package/vscode/src/vs/base/common/actions.d.ts +1 -15
- package/vscode/src/vs/base/common/async.d.ts +1 -31
- package/vscode/src/vs/base/common/event.d.ts +2 -1
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +23 -10
- package/vscode/src/vs/base/common/prefixTree.js +140 -0
- package/vscode/src/vs/base/common/product.d.ts +16 -2
- package/vscode/src/vs/base/common/resourceTree.js +135 -0
- package/vscode/src/vs/base/common/skipList.js +1 -0
- package/vscode/src/vs/base/common/tfIdf.js +137 -0
- package/vscode/src/vs/base/common/types.d.ts +13 -1
- package/vscode/src/vs/base/common/verifier.js +62 -0
- package/vscode/src/vs/editor/browser/editorBrowser.d.ts +4 -2
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +23 -4
- package/vscode/src/vs/editor/common/core/lineRange.d.ts +1 -0
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +3 -0
- package/vscode/src/vs/editor/common/core/position.d.ts +1 -0
- package/vscode/src/vs/editor/common/editorCommon.d.ts +2 -1
- package/vscode/src/vs/editor/common/languages.d.ts +23 -1
- package/vscode/src/vs/editor/common/services/languageFeatures.d.ts +2 -1
- package/vscode/src/vs/editor/common/services/resolverService.d.ts +11 -2
- package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +16 -1
- package/vscode/src/vs/platform/action/common/action.d.ts +8 -0
- package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +4 -0
- package/vscode/src/vs/platform/actions/browser/floatingMenu.js +26 -2
- package/vscode/src/vs/platform/actions/common/actions.d.ts +8 -0
- package/vscode/src/vs/platform/audioCues/browser/audioCueService.d.ts +6 -0
- package/vscode/src/vs/platform/commands/common/commands.d.ts +13 -5
- package/vscode/src/vs/platform/dialogs/common/dialogs.d.ts +9 -3
- package/vscode/src/vs/platform/dialogs/common/dialogs.js +5 -2
- package/vscode/src/vs/platform/editor/common/editor.d.ts +3 -15
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +1 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +3 -15
- package/vscode/src/vs/platform/extensionManagement/common/implicitActivationEvents.js +5 -0
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +0 -1
- package/vscode/src/vs/platform/files/common/files.d.ts +72 -8
- package/vscode/src/vs/platform/files/common/watcher.js +77 -0
- package/vscode/src/vs/platform/keybinding/common/keybindingsRegistry.d.ts +2 -2
- package/vscode/src/vs/platform/layout/browser/layoutService.d.ts +52 -21
- package/vscode/src/vs/platform/request/browser/requestService.js +3 -0
- package/vscode/src/vs/platform/request/common/requestIpc.js +17 -0
- package/vscode/src/vs/platform/storage/common/storage.js +2 -2
- package/vscode/src/vs/platform/telemetry/common/telemetry.d.ts +1 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +41 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +12 -7
- package/vscode/src/vs/platform/terminal/common/capabilities/{commandDetectionCapability.d.ts → commandDetection/terminalCommand.d.ts} +3 -2
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.js +257 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +651 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +29 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +48 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +94 -0
- package/vscode/src/vs/platform/terminal/common/terminalEnvironment.js +37 -0
- package/vscode/src/vs/platform/terminal/common/terminalStrings.js +16 -0
- package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +319 -0
- package/vscode/src/vs/platform/window/common/window.d.ts +9 -2
- package/vscode/src/vs/platform/window/common/window.js +6 -1
- package/vscode/src/vs/platform/workspaces/common/workspaces.d.ts +2 -43
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +113 -81
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +5 -4
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +25 -3
- package/vscode/src/vs/workbench/api/common/extHostChat.js +13 -163
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +412 -0
- package/vscode/src/vs/workbench/api/common/extHostChatProvider.js +79 -11
- package/vscode/src/vs/workbench/api/common/extHostCommands.js +13 -12
- package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostEditorTabs.js +8 -6
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostFileSystemEventService.js +36 -19
- package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +52 -31
- package/vscode/src/vs/workbench/api/common/extHostIssueReporter.js +38 -0
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +28 -3
- package/vscode/src/vs/workbench/api/common/extHostLanguages.js +10 -0
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +117 -2
- package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +32 -4
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +85 -23
- package/vscode/src/vs/workbench/api/common/extHostSearch.js +3 -0
- package/vscode/src/vs/workbench/api/common/extHostSpeech.js +42 -0
- package/vscode/src/vs/workbench/api/common/extHostTask.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -0
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +97 -47
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +115 -16
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +66 -36
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +6 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +182 -75
- package/vscode/src/vs/workbench/browser/actions/windowActions.js +176 -4
- package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +143 -2
- package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +237 -0
- package/vscode/src/vs/workbench/browser/composite.d.ts +0 -4
- package/vscode/src/vs/workbench/browser/composite.js +5 -4
- package/vscode/src/vs/workbench/browser/dnd.js +72 -23
- package/vscode/src/vs/workbench/browser/labels.js +7 -3
- package/vscode/src/vs/workbench/browser/media/part.css.js +1 -1
- package/vscode/src/vs/workbench/browser/panecomposite.d.ts +2 -2
- package/vscode/src/vs/workbench/browser/panecomposite.js +2 -0
- package/vscode/src/vs/workbench/browser/part.js +33 -2
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +99 -117
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +173 -33
- package/vscode/src/vs/workbench/browser/parts/editor/editor.js +102 -6
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +256 -17
- package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +68 -35
- package/vscode/src/vs/workbench/browser/parts/editor/editorPlaceholder.js +5 -5
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +35 -16
- package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +348 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorsObserver.js +43 -31
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortabscontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -0
- package/vscode/src/vs/workbench/browser/parts/editor/textCodeEditor.js +1 -0
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +14 -2
- package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +4 -4
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +277 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +5 -2
- package/vscode/src/vs/workbench/browser/parts/panel/media/panelpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +3 -38
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.d.ts +54 -52
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +2 -1
- package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.d.ts +25 -0
- package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +258 -0
- package/vscode/src/vs/workbench/browser/parts/views/media/paneviewlet.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.d.ts +2 -5
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +157 -117
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +50 -23
- package/vscode/src/vs/workbench/browser/parts/views/viewsService.js +26 -11
- package/vscode/src/vs/workbench/browser/parts/views/viewsViewlet.js +10 -6
- package/vscode/src/vs/workbench/browser/style.js +2 -1
- package/vscode/src/vs/workbench/browser/web.api.d.ts +39 -2
- package/vscode/src/vs/workbench/browser/window.js +55 -0
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +220 -40
- package/vscode/src/vs/workbench/common/activity.js +3 -0
- package/vscode/src/vs/workbench/common/contextkeys.js +35 -5
- package/vscode/src/vs/workbench/common/contributions.js +4 -3
- package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +14 -4
- package/vscode/src/vs/workbench/common/editor/diffEditorModel.js +1 -1
- package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +22 -19
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +4 -3
- package/vscode/src/vs/workbench/common/editor/editorModel.d.ts +1 -2
- package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +22 -4
- package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.js +3 -3
- package/vscode/src/vs/workbench/common/editor.d.ts +60 -30
- package/vscode/src/vs/workbench/common/editor.js +11 -3
- package/vscode/src/vs/workbench/common/theme.js +2 -2
- package/vscode/src/vs/workbench/common/views.d.ts +4 -4
- package/vscode/src/vs/workbench/common/views.js +3 -1
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +97 -8
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +17 -99
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +103 -37
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +2 -3
- package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +127 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +33 -110
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +64 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +94 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +1 -88
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +3 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +15 -16
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +91 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +9 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +3 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +2 -3
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +1 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +10 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +114 -22
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +4 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerFileContrib.js +19 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +10 -8
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +62 -10
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +9 -8
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +10 -1
- package/vscode/src/vs/workbench/contrib/files/browser/files.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.js +7 -3
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +64 -36
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +42 -17
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +145 -25
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +423 -0
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +82 -0
- package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +36 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +3 -1
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +24 -3
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +11 -6
- package/vscode/src/vs/workbench/contrib/scm/common/scm.js +1 -2
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/searchNotebookHelpers.js +31 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +61 -41
- package/vscode/src/vs/workbench/contrib/search/{browser/searchNotebookHelpers.js → common/cellSearchModel.js} +4 -63
- package/vscode/src/vs/workbench/contrib/search/common/searchNotebookHelpers.js +40 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +2 -2
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +3 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/detachedTerminal.js +92 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +100 -79
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +25 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcon.js +7 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +64 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +36 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +540 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +104 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +518 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +390 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +17 -11
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +814 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm-private.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +2 -8
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -0
- package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +101 -0
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +30 -0
- package/vscode/src/vs/workbench/contrib/testing/common/storedValue.js +36 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +115 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverageService.js +74 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testExplorerFilterState.js +116 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testProfileService.js +172 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +384 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResultService.js +156 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testResultStorage.js +156 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testService.js +75 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +72 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testingContextKeys.js +188 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingContinuousRunService.js +102 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingDecorations.js +29 -0
- package/vscode/src/vs/workbench/{services/editor/browser/editorDropService.js → contrib/testing/common/testingPeekOpener.js} +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +47 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.js +4 -3
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +8 -9
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewIconManager.js +5 -2
- package/vscode/src/vs/workbench/services/activity/browser/activityService.d.ts +16 -10
- package/vscode/src/vs/workbench/services/activity/common/activity.d.ts +14 -1
- package/vscode/src/vs/workbench/services/activity/common/activity.js +1 -7
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +9 -28
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +273 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolver.js +1 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +2 -0
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +2 -3
- package/vscode/src/vs/workbench/services/editor/browser/editorService.d.ts +7 -5
- package/vscode/src/vs/workbench/services/editor/browser/editorService.js +59 -37
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +193 -94
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.js +2 -2
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.d.ts +8 -2
- package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +8 -1
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +62 -16
- package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +5 -3
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +3 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +4 -9
- package/vscode/src/vs/workbench/services/extensions/common/{extensionHostManager.d.ts → extensionHostManagers.d.ts} +2 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +9 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +22 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +14 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +9 -0
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +3 -3
- package/vscode/src/vs/workbench/services/history/common/history.d.ts +2 -2
- package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +49 -18
- package/vscode/src/vs/workbench/services/host/browser/host.d.ts +29 -7
- package/vscode/src/vs/workbench/services/hover/browser/hover.d.ts +51 -28
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.d.ts +5 -2
- package/vscode/src/vs/workbench/services/keybinding/browser/unboundCommands.js +2 -2
- package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.d.ts +4 -1
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.d.ts +40 -36
- package/vscode/src/vs/workbench/services/panecomposite/browser/panecomposite.d.ts +0 -6
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +3 -0
- package/vscode/src/vs/workbench/services/progress/browser/progressIndicator.js +2 -2
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +16 -1
- package/vscode/src/vs/workbench/services/request/browser/requestService.js +48 -0
- package/vscode/src/vs/workbench/services/search/common/searchHelpers.js +4 -4
- package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.d.ts +10 -51
- package/vscode/src/vs/workbench/services/suggest/browser/media/suggest.css.js +4 -0
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.js +10 -0
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.js +98 -0
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +428 -0
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +83 -0
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +32 -1
- package/vscode/src/vs/workbench/services/textfile/common/textEditorService.js +1 -5
- package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +4 -3
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +9 -3
- package/vscode/src/vs/workbench/services/title/browser/titleService.d.ts +18 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorInput.js +18 -3
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorModel.js +16 -7
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.d.ts +6 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +13 -0
- package/vscode/src/vs/workbench/services/url/browser/urlService.js +2 -1
- package/vscode/src/vs/workbench/services/userActivity/common/userActivityService.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +9 -0
- package/vscode-dts/vscode.proposed.chatAgents2.d.ts +375 -0
- package/vscode-dts/vscode.proposed.chatAgents2Additions.d.ts +80 -0
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +5 -1
- package/vscode-dts/vscode.proposed.chatRequestAccess.d.ts +68 -10
- package/vscode-dts/vscode.proposed.chatTab.d.ts +21 -0
- package/vscode-dts/vscode.proposed.chatVariables.d.ts +5 -1
- package/vscode-dts/vscode.proposed.codeActionAI.d.ts +16 -0
- package/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts +7 -0
- package/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts +51 -0
- package/vscode-dts/vscode.proposed.defaultChatAgent.d.ts +30 -0
- package/vscode-dts/vscode.proposed.handleIssueUri.d.ts +26 -0
- package/vscode-dts/vscode.proposed.interactive.d.ts +26 -100
- package/vscode-dts/vscode.proposed.interactiveUserActions.d.ts +14 -7
- package/vscode-dts/vscode.proposed.languageStatusText.d.ts +12 -0
- package/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts +63 -0
- package/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts +43 -0
- package/vscode-dts/vscode.proposed.resolvers.d.ts +100 -1
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +9 -1
- package/vscode-dts/vscode.proposed.scmInputBoxActionButton.d.ts +19 -0
- package/vscode-dts/vscode.proposed.scmInputBoxValueProvider.d.ts +25 -0
- package/vscode-dts/vscode.proposed.speech.d.ts +35 -0
- package/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts +11 -7
- package/vscode-dts/vscode.proposed.testCoverage.d.ts +6 -1
- package/vscode-dts/vscode.proposed.testingActiveProfile.d.ts +21 -0
- package/external/xterm-headless/typings/xterm-headless.d.ts +0 -49
- package/vscode/src/vs/platform/backup/common/backup.d.ts +0 -14
- package/vscode/src/vs/platform/update/common/update.d.ts +0 -112
- package/vscode/src/vs/workbench/api/common/extHostChatAgents.js +0 -62
- package/vscode/src/vs/workbench/api/common/extHostChatSlashCommand.js +0 -62
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +0 -56
- package/vscode/src/vs/workbench/services/files/common/files.js +0 -4
- package/vscode/src/vs/workbench/services/host/browser/browserHostService.d.ts +0 -41
- package/vscode/src/vs/workbench/services/title/common/titleService.d.ts +0 -31
- package/vscode-dts/vscode.proposed.chatAgents.d.ts +0 -39
- package/vscode-dts/vscode.proposed.chatSlashCommands.d.ts +0 -47
- package/vscode-dts/vscode.proposed.testMessageContextValue.d.ts +0 -45
- /package/external/{xterm-addon-canvas/typings/xterm-addon-canvas.d.ts → @xterm/addon-canvas/typings/addon-canvas.d.ts} +0 -0
- /package/external/{xterm-addon-search/typings/xterm-addon-search.d.ts → @xterm/addon-search/typings/addon-search.d.ts} +0 -0
- /package/external/{xterm-addon-serialize/typings/xterm-addon-serialize.d.ts → @xterm/addon-serialize/typings/addon-serialize.d.ts} +0 -0
- /package/external/{xterm-addon-unicode11/typings/xterm-addon-unicode11.d.ts → @xterm/addon-unicode11/typings/addon-unicode11.d.ts} +0 -0
- /package/external/{xterm-addon-webgl/typings/xterm-addon-webgl.d.ts → @xterm/addon-webgl/typings/addon-webgl.d.ts} +0 -0
- /package/vscode/src/vs/workbench/services/title/{common → browser}/titleService.js +0 -0
|
@@ -0,0 +1,814 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
4
|
+
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
|
+
import { ITerminalLogService } from '../../../../../platform/terminal/common/terminal.js';
|
|
6
|
+
import { isSafari } from 'monaco-editor/esm/vs/base/browser/browser.js';
|
|
7
|
+
import { LogLevel } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
8
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
9
|
+
import { Severity, INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
10
|
+
import { MarkNavigationAddon } from './markNavigationAddon.js';
|
|
11
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
12
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
13
|
+
import { PANEL_BACKGROUND } from '../../../../common/theme.js';
|
|
14
|
+
import { TERMINAL_BACKGROUND_COLOR, TERMINAL_FIND_MATCH_BACKGROUND_COLOR, TERMINAL_FIND_MATCH_BORDER_COLOR, TERMINAL_OVERVIEW_RULER_CURSOR_FOREGROUND_COLOR, TERMINAL_FIND_MATCH_HIGHLIGHT_BACKGROUND_COLOR, TERMINAL_FIND_MATCH_HIGHLIGHT_BORDER_COLOR, TERMINAL_OVERVIEW_RULER_FIND_MATCH_FOREGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_CURSOR_FOREGROUND_COLOR, TERMINAL_CURSOR_BACKGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_COLOR, TERMINAL_INACTIVE_SELECTION_BACKGROUND_COLOR, TERMINAL_SELECTION_FOREGROUND_COLOR, ansiColorIdentifiers } from '../../common/terminalColorRegistry.js';
|
|
15
|
+
import { ShellIntegrationAddon } from '../../../../../platform/terminal/common/xterm/shellIntegrationAddon.js';
|
|
16
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
17
|
+
import { DecorationAddon } from './decorationAddon.js';
|
|
18
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
19
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
20
|
+
import { SuggestAddon } from './suggestAddon.js';
|
|
21
|
+
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
22
|
+
import { TerminalContextKeys } from '../../common/terminalContextKey.js';
|
|
23
|
+
import { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
|
|
24
|
+
import { debounce } from 'monaco-editor/esm/vs/base/common/decorators.js';
|
|
25
|
+
import { MouseWheelClassifier } from 'monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js';
|
|
26
|
+
import { StandardWheelEvent } from 'monaco-editor/esm/vs/base/browser/mouseEvent.js';
|
|
27
|
+
import { IAccessibleNotificationService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
|
|
28
|
+
import { ILayoutService } from 'monaco-editor/esm/vs/platform/layout/browser/layoutService.js';
|
|
29
|
+
var XtermTerminal_1;
|
|
30
|
+
let CanvasAddon;
|
|
31
|
+
let ImageAddon;
|
|
32
|
+
let SearchAddon;
|
|
33
|
+
let SerializeAddon;
|
|
34
|
+
let Unicode11Addon;
|
|
35
|
+
let WebglAddon;
|
|
36
|
+
function getFullBufferLineAsString(lineIndex, buffer) {
|
|
37
|
+
let line = buffer.getLine(lineIndex);
|
|
38
|
+
if (!line) {
|
|
39
|
+
return { lineData: undefined, lineIndex };
|
|
40
|
+
}
|
|
41
|
+
let lineData = line.translateToString(true);
|
|
42
|
+
while (lineIndex > 0 && line.isWrapped) {
|
|
43
|
+
line = buffer.getLine(--lineIndex);
|
|
44
|
+
if (!line) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
lineData = line.translateToString(false) + lineData;
|
|
48
|
+
}
|
|
49
|
+
return { lineData, lineIndex };
|
|
50
|
+
}
|
|
51
|
+
let XtermTerminal = class XtermTerminal extends Disposable {
|
|
52
|
+
static { XtermTerminal_1 = this; }
|
|
53
|
+
static { this._suggestedRendererType = undefined; }
|
|
54
|
+
static { this._checkedWebglCompatible = false; }
|
|
55
|
+
get findResult() { return this._lastFindResult; }
|
|
56
|
+
get isStdinDisabled() { return !!this.raw.options.disableStdin; }
|
|
57
|
+
get isGpuAccelerated() { return !!(this._canvasAddon || this._webglAddon); }
|
|
58
|
+
get markTracker() { return this._markNavigationAddon; }
|
|
59
|
+
get shellIntegration() { return this._shellIntegrationAddon; }
|
|
60
|
+
get suggestController() { return this._suggestAddon; }
|
|
61
|
+
get textureAtlas() {
|
|
62
|
+
const canvas = this._webglAddon?.textureAtlas || this._canvasAddon?.textureAtlas;
|
|
63
|
+
if (!canvas) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
return createImageBitmap(canvas);
|
|
67
|
+
}
|
|
68
|
+
get isFocused() {
|
|
69
|
+
if (!this.raw.element) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return dom.isAncestorOfActiveElement(this.raw.element);
|
|
73
|
+
}
|
|
74
|
+
constructor(xtermCtor, _configHelper, cols, rows, _xtermColorProvider, _capabilities, shellIntegrationNonce, _terminalSuggestWidgetVisibleContextKey, disableShellIntegrationReporting, _configurationService, _instantiationService, _logService, _notificationService, _storageService, _themeService, _telemetryService, _clipboardService, contextKeyService, _accessibleNotificationService, layoutService) {
|
|
75
|
+
super();
|
|
76
|
+
this._configHelper = _configHelper;
|
|
77
|
+
this._xtermColorProvider = _xtermColorProvider;
|
|
78
|
+
this._capabilities = _capabilities;
|
|
79
|
+
this._terminalSuggestWidgetVisibleContextKey = _terminalSuggestWidgetVisibleContextKey;
|
|
80
|
+
this._configurationService = _configurationService;
|
|
81
|
+
this._instantiationService = _instantiationService;
|
|
82
|
+
this._logService = _logService;
|
|
83
|
+
this._notificationService = _notificationService;
|
|
84
|
+
this._storageService = _storageService;
|
|
85
|
+
this._themeService = _themeService;
|
|
86
|
+
this._telemetryService = _telemetryService;
|
|
87
|
+
this._clipboardService = _clipboardService;
|
|
88
|
+
this._accessibleNotificationService = _accessibleNotificationService;
|
|
89
|
+
this._isPhysicalMouseWheel = MouseWheelClassifier.INSTANCE.isPhysicalMouseWheel();
|
|
90
|
+
this._attachedDisposables = this._register(( new DisposableStore()));
|
|
91
|
+
this._onDidRequestRunCommand = this._register(( new Emitter()));
|
|
92
|
+
this.onDidRequestRunCommand = this._onDidRequestRunCommand.event;
|
|
93
|
+
this._onDidRequestFocus = this._register(( new Emitter()));
|
|
94
|
+
this.onDidRequestFocus = this._onDidRequestFocus.event;
|
|
95
|
+
this._onDidRequestSendText = this._register(( new Emitter()));
|
|
96
|
+
this.onDidRequestSendText = this._onDidRequestSendText.event;
|
|
97
|
+
this._onDidRequestFreePort = this._register(( new Emitter()));
|
|
98
|
+
this.onDidRequestFreePort = this._onDidRequestFreePort.event;
|
|
99
|
+
this._onDidChangeFindResults = this._register(( new Emitter()));
|
|
100
|
+
this.onDidChangeFindResults = this._onDidChangeFindResults.event;
|
|
101
|
+
this._onDidChangeSelection = this._register(( new Emitter()));
|
|
102
|
+
this.onDidChangeSelection = this._onDidChangeSelection.event;
|
|
103
|
+
this._onDidChangeFocus = this._register(( new Emitter()));
|
|
104
|
+
this.onDidChangeFocus = this._onDidChangeFocus.event;
|
|
105
|
+
this._onDidDispose = this._register(( new Emitter()));
|
|
106
|
+
this.onDidDispose = this._onDidDispose.event;
|
|
107
|
+
const font = this._configHelper.getFont(dom.getActiveWindow(), undefined, true);
|
|
108
|
+
const config = this._configHelper.config;
|
|
109
|
+
const editorOptions = this._configurationService.getValue('editor');
|
|
110
|
+
this.raw = this._register(( new xtermCtor({
|
|
111
|
+
allowProposedApi: true,
|
|
112
|
+
cols,
|
|
113
|
+
rows,
|
|
114
|
+
documentOverride: layoutService.mainContainer.ownerDocument,
|
|
115
|
+
altClickMovesCursor: config.altClickMovesCursor && editorOptions.multiCursorModifier === 'alt',
|
|
116
|
+
scrollback: config.scrollback,
|
|
117
|
+
theme: this.getXtermTheme(),
|
|
118
|
+
drawBoldTextInBrightColors: config.drawBoldTextInBrightColors,
|
|
119
|
+
fontFamily: font.fontFamily,
|
|
120
|
+
fontWeight: config.fontWeight,
|
|
121
|
+
fontWeightBold: config.fontWeightBold,
|
|
122
|
+
fontSize: font.fontSize,
|
|
123
|
+
letterSpacing: font.letterSpacing,
|
|
124
|
+
lineHeight: font.lineHeight,
|
|
125
|
+
logLevel: vscodeToXtermLogLevel(this._logService.getLevel()),
|
|
126
|
+
logger: this._logService,
|
|
127
|
+
minimumContrastRatio: config.minimumContrastRatio,
|
|
128
|
+
tabStopWidth: config.tabStopWidth,
|
|
129
|
+
cursorBlink: config.cursorBlinking,
|
|
130
|
+
cursorStyle: vscodeToXtermCursorStyle(config.cursorStyle),
|
|
131
|
+
cursorInactiveStyle: vscodeToXtermCursorStyle(config.cursorStyleInactive),
|
|
132
|
+
cursorWidth: config.cursorWidth,
|
|
133
|
+
macOptionIsMeta: config.macOptionIsMeta,
|
|
134
|
+
macOptionClickForcesSelection: config.macOptionClickForcesSelection,
|
|
135
|
+
rightClickSelectsWord: config.rightClickBehavior === 'selectWord',
|
|
136
|
+
fastScrollModifier: 'alt',
|
|
137
|
+
fastScrollSensitivity: config.fastScrollSensitivity,
|
|
138
|
+
scrollSensitivity: config.mouseWheelScrollSensitivity,
|
|
139
|
+
wordSeparator: config.wordSeparators,
|
|
140
|
+
overviewRulerWidth: 10,
|
|
141
|
+
ignoreBracketedPasteMode: config.ignoreBracketedPasteMode
|
|
142
|
+
})));
|
|
143
|
+
this._updateSmoothScrolling();
|
|
144
|
+
this._core = this.raw._core;
|
|
145
|
+
this._register(this._configurationService.onDidChangeConfiguration(async (e) => {
|
|
146
|
+
if (e.affectsConfiguration("terminal.integrated.gpuAcceleration" )) {
|
|
147
|
+
XtermTerminal_1._suggestedRendererType = undefined;
|
|
148
|
+
}
|
|
149
|
+
if (e.affectsConfiguration('terminal.integrated') || e.affectsConfiguration('editor.fastScrollSensitivity') || e.affectsConfiguration('editor.mouseWheelScrollSensitivity') || e.affectsConfiguration('editor.multiCursorModifier')) {
|
|
150
|
+
this.updateConfig();
|
|
151
|
+
}
|
|
152
|
+
if (e.affectsConfiguration("terminal.integrated.unicodeVersion" )) {
|
|
153
|
+
this._updateUnicodeVersion();
|
|
154
|
+
}
|
|
155
|
+
}));
|
|
156
|
+
this._register(this._themeService.onDidColorThemeChange(theme => this._updateTheme(theme)));
|
|
157
|
+
this._register(this._logService.onDidChangeLogLevel(e => this.raw.options.logLevel = vscodeToXtermLogLevel(e)));
|
|
158
|
+
this._register(this.raw.onSelectionChange(() => {
|
|
159
|
+
this._onDidChangeSelection.fire();
|
|
160
|
+
if (this.isFocused) {
|
|
161
|
+
this._anyFocusedTerminalHasSelection.set(this.raw.hasSelection());
|
|
162
|
+
}
|
|
163
|
+
}));
|
|
164
|
+
this._updateUnicodeVersion();
|
|
165
|
+
this._markNavigationAddon = this._instantiationService.createInstance(MarkNavigationAddon, _capabilities);
|
|
166
|
+
this.raw.loadAddon(this._markNavigationAddon);
|
|
167
|
+
this._decorationAddon = this._instantiationService.createInstance(DecorationAddon, this._capabilities);
|
|
168
|
+
this._register(this._decorationAddon.onDidRequestRunCommand(e => this._onDidRequestRunCommand.fire(e)));
|
|
169
|
+
this.raw.loadAddon(this._decorationAddon);
|
|
170
|
+
this._shellIntegrationAddon = ( new ShellIntegrationAddon(
|
|
171
|
+
shellIntegrationNonce,
|
|
172
|
+
disableShellIntegrationReporting,
|
|
173
|
+
this._telemetryService,
|
|
174
|
+
this._logService
|
|
175
|
+
));
|
|
176
|
+
this.raw.loadAddon(this._shellIntegrationAddon);
|
|
177
|
+
this._anyTerminalFocusContextKey = TerminalContextKeys.focusInAny.bindTo(contextKeyService);
|
|
178
|
+
this._anyFocusedTerminalHasSelection = TerminalContextKeys.textSelectedInFocused.bindTo(contextKeyService);
|
|
179
|
+
if (this._terminalSuggestWidgetVisibleContextKey) {
|
|
180
|
+
this._suggestAddon = this._register(this._instantiationService.createInstance(SuggestAddon, this._terminalSuggestWidgetVisibleContextKey));
|
|
181
|
+
this.raw.loadAddon(this._suggestAddon);
|
|
182
|
+
this._register(this._suggestAddon.onAcceptedCompletion(async (text) => {
|
|
183
|
+
this._onDidRequestFocus.fire();
|
|
184
|
+
this._onDidRequestSendText.fire(text);
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
*getBufferReverseIterator() {
|
|
189
|
+
for (let i = this.raw.buffer.active.length; i >= 0; i--) {
|
|
190
|
+
const { lineData, lineIndex } = getFullBufferLineAsString(i, this.raw.buffer.active);
|
|
191
|
+
if (lineData) {
|
|
192
|
+
i = lineIndex;
|
|
193
|
+
yield lineData;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
async getContentsAsHtml() {
|
|
198
|
+
if (!this._serializeAddon) {
|
|
199
|
+
const Addon = await this._getSerializeAddonConstructor();
|
|
200
|
+
this._serializeAddon = ( new Addon());
|
|
201
|
+
this.raw.loadAddon(this._serializeAddon);
|
|
202
|
+
}
|
|
203
|
+
return this._serializeAddon.serializeAsHTML();
|
|
204
|
+
}
|
|
205
|
+
async getSelectionAsHtml(command) {
|
|
206
|
+
if (!this._serializeAddon) {
|
|
207
|
+
const Addon = await this._getSerializeAddonConstructor();
|
|
208
|
+
this._serializeAddon = ( new Addon());
|
|
209
|
+
this.raw.loadAddon(this._serializeAddon);
|
|
210
|
+
}
|
|
211
|
+
if (command) {
|
|
212
|
+
const length = command.getOutput()?.length;
|
|
213
|
+
const row = command.marker?.line;
|
|
214
|
+
if (!length || !row) {
|
|
215
|
+
throw new Error(`No row ${row} or output length ${length} for command ${command}`);
|
|
216
|
+
}
|
|
217
|
+
this.raw.select(0, row + 1, length - Math.floor(length / this.raw.cols));
|
|
218
|
+
}
|
|
219
|
+
const result = this._serializeAddon.serializeAsHTML({ onlySelection: true });
|
|
220
|
+
if (command) {
|
|
221
|
+
this.raw.clearSelection();
|
|
222
|
+
}
|
|
223
|
+
return result;
|
|
224
|
+
}
|
|
225
|
+
attachToElement(container, partialOptions) {
|
|
226
|
+
const options = { enableGpu: true, ...partialOptions };
|
|
227
|
+
if (!this._attached) {
|
|
228
|
+
this.raw.open(container);
|
|
229
|
+
}
|
|
230
|
+
if (options.enableGpu) {
|
|
231
|
+
if (this._shouldLoadWebgl()) {
|
|
232
|
+
this._enableWebglRenderer();
|
|
233
|
+
}
|
|
234
|
+
else if (this._shouldLoadCanvas()) {
|
|
235
|
+
this._enableCanvasRenderer();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (!this.raw.element || !this.raw.textarea) {
|
|
239
|
+
throw new Error('xterm elements not set after open');
|
|
240
|
+
}
|
|
241
|
+
const ad = this._attachedDisposables;
|
|
242
|
+
ad.clear();
|
|
243
|
+
ad.add(dom.addDisposableListener(this.raw.textarea, 'focus', () => this._setFocused(true)));
|
|
244
|
+
ad.add(dom.addDisposableListener(this.raw.textarea, 'blur', () => this._setFocused(false)));
|
|
245
|
+
ad.add(dom.addDisposableListener(this.raw.textarea, 'focusout', () => this._setFocused(false)));
|
|
246
|
+
ad.add(dom.addDisposableListener(this.raw.element, dom.EventType.MOUSE_WHEEL, (e) => {
|
|
247
|
+
const classifier = MouseWheelClassifier.INSTANCE;
|
|
248
|
+
classifier.acceptStandardWheelEvent(( new StandardWheelEvent(e)));
|
|
249
|
+
const value = classifier.isPhysicalMouseWheel();
|
|
250
|
+
if (value !== this._isPhysicalMouseWheel) {
|
|
251
|
+
this._isPhysicalMouseWheel = value;
|
|
252
|
+
this._updateSmoothScrolling();
|
|
253
|
+
}
|
|
254
|
+
}, { passive: true }));
|
|
255
|
+
this._suggestAddon?.setContainer(container);
|
|
256
|
+
this._attached = { container, options };
|
|
257
|
+
return this._attached?.container.querySelector('.xterm-screen');
|
|
258
|
+
}
|
|
259
|
+
_setFocused(isFocused) {
|
|
260
|
+
this._onDidChangeFocus.fire(isFocused);
|
|
261
|
+
this._anyTerminalFocusContextKey.set(isFocused);
|
|
262
|
+
this._anyFocusedTerminalHasSelection.set(isFocused && this.raw.hasSelection());
|
|
263
|
+
}
|
|
264
|
+
write(data, callback) {
|
|
265
|
+
this.raw.write(data, callback);
|
|
266
|
+
}
|
|
267
|
+
resize(columns, rows) {
|
|
268
|
+
this.raw.resize(columns, rows);
|
|
269
|
+
}
|
|
270
|
+
updateConfig() {
|
|
271
|
+
const config = this._configHelper.config;
|
|
272
|
+
this.raw.options.altClickMovesCursor = config.altClickMovesCursor;
|
|
273
|
+
this._setCursorBlink(config.cursorBlinking);
|
|
274
|
+
this._setCursorStyle(config.cursorStyle);
|
|
275
|
+
this._setCursorStyleInactive(config.cursorStyleInactive);
|
|
276
|
+
this._setCursorWidth(config.cursorWidth);
|
|
277
|
+
this.raw.options.scrollback = config.scrollback;
|
|
278
|
+
this.raw.options.drawBoldTextInBrightColors = config.drawBoldTextInBrightColors;
|
|
279
|
+
this.raw.options.minimumContrastRatio = config.minimumContrastRatio;
|
|
280
|
+
this.raw.options.tabStopWidth = config.tabStopWidth;
|
|
281
|
+
this.raw.options.fastScrollSensitivity = config.fastScrollSensitivity;
|
|
282
|
+
this.raw.options.scrollSensitivity = config.mouseWheelScrollSensitivity;
|
|
283
|
+
this.raw.options.macOptionIsMeta = config.macOptionIsMeta;
|
|
284
|
+
const editorOptions = this._configurationService.getValue('editor');
|
|
285
|
+
this.raw.options.altClickMovesCursor = config.altClickMovesCursor && editorOptions.multiCursorModifier === 'alt';
|
|
286
|
+
this.raw.options.macOptionClickForcesSelection = config.macOptionClickForcesSelection;
|
|
287
|
+
this.raw.options.rightClickSelectsWord = config.rightClickBehavior === 'selectWord';
|
|
288
|
+
this.raw.options.wordSeparator = config.wordSeparators;
|
|
289
|
+
this.raw.options.customGlyphs = config.customGlyphs;
|
|
290
|
+
this.raw.options.ignoreBracketedPasteMode = config.ignoreBracketedPasteMode;
|
|
291
|
+
this._updateSmoothScrolling();
|
|
292
|
+
if (this._attached?.options.enableGpu) {
|
|
293
|
+
if (this._shouldLoadWebgl()) {
|
|
294
|
+
this._enableWebglRenderer();
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
this._disposeOfWebglRenderer();
|
|
298
|
+
if (this._shouldLoadCanvas()) {
|
|
299
|
+
this._enableCanvasRenderer();
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
this._disposeOfCanvasRenderer();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
_updateSmoothScrolling() {
|
|
308
|
+
this.raw.options.smoothScrollDuration = this._configHelper.config.smoothScrolling && this._isPhysicalMouseWheel ? 125 : 0;
|
|
309
|
+
}
|
|
310
|
+
_shouldLoadWebgl() {
|
|
311
|
+
return !isSafari && (this._configHelper.config.gpuAcceleration === 'auto' && XtermTerminal_1._suggestedRendererType === undefined) || this._configHelper.config.gpuAcceleration === 'on';
|
|
312
|
+
}
|
|
313
|
+
_shouldLoadCanvas() {
|
|
314
|
+
return (this._configHelper.config.gpuAcceleration === 'auto' && (XtermTerminal_1._suggestedRendererType === undefined || XtermTerminal_1._suggestedRendererType === 'canvas')) || this._configHelper.config.gpuAcceleration === 'canvas';
|
|
315
|
+
}
|
|
316
|
+
forceRedraw() {
|
|
317
|
+
this.raw.clearTextureAtlas();
|
|
318
|
+
}
|
|
319
|
+
clearDecorations() {
|
|
320
|
+
this._decorationAddon?.clearDecorations();
|
|
321
|
+
}
|
|
322
|
+
forceRefresh() {
|
|
323
|
+
this._core.viewport?._innerRefresh();
|
|
324
|
+
}
|
|
325
|
+
forceUnpause() {
|
|
326
|
+
if (!!this._canvasAddon) {
|
|
327
|
+
this._core._renderService?._handleIntersectionChange({ intersectionRatio: 1 });
|
|
328
|
+
this.raw.refresh(0, this.raw.rows - 1);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
async findNext(term, searchOptions) {
|
|
332
|
+
this._updateFindColors(searchOptions);
|
|
333
|
+
return (await this._getSearchAddon()).findNext(term, searchOptions);
|
|
334
|
+
}
|
|
335
|
+
async findPrevious(term, searchOptions) {
|
|
336
|
+
this._updateFindColors(searchOptions);
|
|
337
|
+
return (await this._getSearchAddon()).findPrevious(term, searchOptions);
|
|
338
|
+
}
|
|
339
|
+
_updateFindColors(searchOptions) {
|
|
340
|
+
const theme = this._themeService.getColorTheme();
|
|
341
|
+
const terminalBackground = theme.getColor(TERMINAL_BACKGROUND_COLOR) || theme.getColor(PANEL_BACKGROUND);
|
|
342
|
+
const findMatchBackground = theme.getColor(TERMINAL_FIND_MATCH_BACKGROUND_COLOR);
|
|
343
|
+
const findMatchBorder = theme.getColor(TERMINAL_FIND_MATCH_BORDER_COLOR);
|
|
344
|
+
const findMatchOverviewRuler = theme.getColor(TERMINAL_OVERVIEW_RULER_CURSOR_FOREGROUND_COLOR);
|
|
345
|
+
const findMatchHighlightBackground = theme.getColor(TERMINAL_FIND_MATCH_HIGHLIGHT_BACKGROUND_COLOR);
|
|
346
|
+
const findMatchHighlightBorder = theme.getColor(TERMINAL_FIND_MATCH_HIGHLIGHT_BORDER_COLOR);
|
|
347
|
+
const findMatchHighlightOverviewRuler = theme.getColor(TERMINAL_OVERVIEW_RULER_FIND_MATCH_FOREGROUND_COLOR);
|
|
348
|
+
searchOptions.decorations = {
|
|
349
|
+
activeMatchBackground: findMatchBackground?.toString(),
|
|
350
|
+
activeMatchBorder: findMatchBorder?.toString() || 'transparent',
|
|
351
|
+
activeMatchColorOverviewRuler: findMatchOverviewRuler?.toString() || 'transparent',
|
|
352
|
+
matchBackground: terminalBackground ? findMatchHighlightBackground?.blend(terminalBackground).toString() : undefined,
|
|
353
|
+
matchBorder: findMatchHighlightBorder?.toString() || 'transparent',
|
|
354
|
+
matchOverviewRuler: findMatchHighlightOverviewRuler?.toString() || 'transparent'
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
_getSearchAddon() {
|
|
358
|
+
if (!this._searchAddonPromise) {
|
|
359
|
+
this._searchAddonPromise = this._getSearchAddonConstructor().then((AddonCtor) => {
|
|
360
|
+
this._searchAddon = ( new AddonCtor({ highlightLimit: 1000 }));
|
|
361
|
+
this.raw.loadAddon(this._searchAddon);
|
|
362
|
+
this._searchAddon.onDidChangeResults((results) => {
|
|
363
|
+
this._lastFindResult = results;
|
|
364
|
+
this._onDidChangeFindResults.fire(results);
|
|
365
|
+
});
|
|
366
|
+
return this._searchAddon;
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
return this._searchAddonPromise;
|
|
370
|
+
}
|
|
371
|
+
clearSearchDecorations() {
|
|
372
|
+
this._searchAddon?.clearDecorations();
|
|
373
|
+
}
|
|
374
|
+
clearActiveSearchDecoration() {
|
|
375
|
+
this._searchAddon?.clearActiveDecoration();
|
|
376
|
+
}
|
|
377
|
+
getFont() {
|
|
378
|
+
return this._configHelper.getFont(dom.getWindow(this.raw.element), this._core);
|
|
379
|
+
}
|
|
380
|
+
getLongestViewportWrappedLineLength() {
|
|
381
|
+
let maxLineLength = 0;
|
|
382
|
+
for (let i = this.raw.buffer.active.length - 1; i >= this.raw.buffer.active.viewportY; i--) {
|
|
383
|
+
const lineInfo = this._getWrappedLineCount(i, this.raw.buffer.active);
|
|
384
|
+
maxLineLength = Math.max(maxLineLength, ((lineInfo.lineCount * this.raw.cols) - lineInfo.endSpaces) || 0);
|
|
385
|
+
i = lineInfo.currentIndex;
|
|
386
|
+
}
|
|
387
|
+
return maxLineLength;
|
|
388
|
+
}
|
|
389
|
+
_getWrappedLineCount(index, buffer) {
|
|
390
|
+
let line = buffer.getLine(index);
|
|
391
|
+
if (!line) {
|
|
392
|
+
throw new Error('Could not get line');
|
|
393
|
+
}
|
|
394
|
+
let currentIndex = index;
|
|
395
|
+
let endSpaces = 0;
|
|
396
|
+
for (let i = Math.min(line.length, this.raw.cols) - 1; i >= 0; i--) {
|
|
397
|
+
if (!line?.getCell(i)?.getChars()) {
|
|
398
|
+
endSpaces++;
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
while (line?.isWrapped && currentIndex > 0) {
|
|
405
|
+
currentIndex--;
|
|
406
|
+
line = buffer.getLine(currentIndex);
|
|
407
|
+
}
|
|
408
|
+
return { lineCount: index - currentIndex + 1, currentIndex, endSpaces };
|
|
409
|
+
}
|
|
410
|
+
scrollDownLine() {
|
|
411
|
+
this.raw.scrollLines(1);
|
|
412
|
+
}
|
|
413
|
+
scrollDownPage() {
|
|
414
|
+
this.raw.scrollPages(1);
|
|
415
|
+
}
|
|
416
|
+
scrollToBottom() {
|
|
417
|
+
this.raw.scrollToBottom();
|
|
418
|
+
}
|
|
419
|
+
scrollUpLine() {
|
|
420
|
+
this.raw.scrollLines(-1);
|
|
421
|
+
}
|
|
422
|
+
scrollUpPage() {
|
|
423
|
+
this.raw.scrollPages(-1);
|
|
424
|
+
}
|
|
425
|
+
scrollToTop() {
|
|
426
|
+
this.raw.scrollToTop();
|
|
427
|
+
}
|
|
428
|
+
scrollToLine(line, position = 0 ) {
|
|
429
|
+
this.markTracker.scrollToLine(line, position);
|
|
430
|
+
}
|
|
431
|
+
clearBuffer() {
|
|
432
|
+
this.raw.clear();
|
|
433
|
+
this._capabilities.get(2 )?.handlePromptStart();
|
|
434
|
+
this._capabilities.get(2 )?.handleCommandStart();
|
|
435
|
+
this._accessibleNotificationService.notify("clear" );
|
|
436
|
+
}
|
|
437
|
+
hasSelection() {
|
|
438
|
+
return this.raw.hasSelection();
|
|
439
|
+
}
|
|
440
|
+
clearSelection() {
|
|
441
|
+
this.raw.clearSelection();
|
|
442
|
+
}
|
|
443
|
+
selectMarkedRange(fromMarkerId, toMarkerId, scrollIntoView = false) {
|
|
444
|
+
const detectionCapability = this.shellIntegration.capabilities.get(4 );
|
|
445
|
+
if (!detectionCapability) {
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
const start = detectionCapability.getMark(fromMarkerId);
|
|
449
|
+
const end = detectionCapability.getMark(toMarkerId);
|
|
450
|
+
if (start === undefined || end === undefined) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
this.raw.selectLines(start.line, end.line);
|
|
454
|
+
if (scrollIntoView) {
|
|
455
|
+
this.raw.scrollToLine(start.line);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
selectAll() {
|
|
459
|
+
this.raw.focus();
|
|
460
|
+
this.raw.selectAll();
|
|
461
|
+
}
|
|
462
|
+
focus() {
|
|
463
|
+
this.raw.focus();
|
|
464
|
+
}
|
|
465
|
+
async copySelection(asHtml, command) {
|
|
466
|
+
if (this.hasSelection() || (asHtml && command)) {
|
|
467
|
+
if (asHtml) {
|
|
468
|
+
const textAsHtml = await this.getSelectionAsHtml(command);
|
|
469
|
+
function listener(e) {
|
|
470
|
+
if (!e.clipboardData.types.includes('text/plain')) {
|
|
471
|
+
e.clipboardData.setData('text/plain', command?.getOutput() ?? '');
|
|
472
|
+
}
|
|
473
|
+
e.clipboardData.setData('text/html', textAsHtml);
|
|
474
|
+
e.preventDefault();
|
|
475
|
+
}
|
|
476
|
+
const doc = dom.getDocument(this.raw.element);
|
|
477
|
+
doc.addEventListener('copy', listener);
|
|
478
|
+
doc.execCommand('copy');
|
|
479
|
+
doc.removeEventListener('copy', listener);
|
|
480
|
+
}
|
|
481
|
+
else {
|
|
482
|
+
await this._clipboardService.writeText(this.raw.getSelection());
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
this._notificationService.warn(( localizeWithPath(
|
|
487
|
+
'vs/workbench/contrib/terminal/browser/xterm/xtermTerminal',
|
|
488
|
+
'terminal.integrated.copySelection.noSelection',
|
|
489
|
+
'The terminal has no selection to copy'
|
|
490
|
+
)));
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
_setCursorBlink(blink) {
|
|
494
|
+
if (this.raw.options.cursorBlink !== blink) {
|
|
495
|
+
this.raw.options.cursorBlink = blink;
|
|
496
|
+
this.raw.refresh(0, this.raw.rows - 1);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
_setCursorStyle(style) {
|
|
500
|
+
const mapped = vscodeToXtermCursorStyle(style);
|
|
501
|
+
if (this.raw.options.cursorStyle !== mapped) {
|
|
502
|
+
this.raw.options.cursorStyle = mapped;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
_setCursorStyleInactive(style) {
|
|
506
|
+
const mapped = vscodeToXtermCursorStyle(style);
|
|
507
|
+
if (this.raw.options.cursorInactiveStyle !== mapped) {
|
|
508
|
+
this.raw.options.cursorInactiveStyle = mapped;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
_setCursorWidth(width) {
|
|
512
|
+
if (this.raw.options.cursorWidth !== width) {
|
|
513
|
+
this.raw.options.cursorWidth = width;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
async _enableWebglRenderer() {
|
|
517
|
+
if (!this.raw.element || this._webglAddon) {
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
if (!XtermTerminal_1._checkedWebglCompatible) {
|
|
521
|
+
XtermTerminal_1._checkedWebglCompatible = true;
|
|
522
|
+
const checkCanvas = document.createElement('canvas');
|
|
523
|
+
const checkGl = checkCanvas.getContext('webgl2');
|
|
524
|
+
const debugInfo = checkGl?.getExtension('WEBGL_debug_renderer_info');
|
|
525
|
+
if (checkGl && debugInfo) {
|
|
526
|
+
const renderer = checkGl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
|
|
527
|
+
if (renderer.startsWith('ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero)')) {
|
|
528
|
+
this._disableWebglForThisSession();
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const Addon = await this._getWebglAddonConstructor();
|
|
534
|
+
this._webglAddon = ( new Addon());
|
|
535
|
+
this._disposeOfCanvasRenderer();
|
|
536
|
+
try {
|
|
537
|
+
this.raw.loadAddon(this._webglAddon);
|
|
538
|
+
this._logService.trace('Webgl was loaded');
|
|
539
|
+
this._webglAddon.onContextLoss(() => {
|
|
540
|
+
this._logService.info(`Webgl lost context, disposing of webgl renderer`);
|
|
541
|
+
this._disposeOfWebglRenderer();
|
|
542
|
+
});
|
|
543
|
+
this._refreshImageAddon();
|
|
544
|
+
}
|
|
545
|
+
catch (e) {
|
|
546
|
+
this._logService.warn(`Webgl could not be loaded. Falling back to the canvas renderer type.`, e);
|
|
547
|
+
const neverMeasureRenderTime = this._storageService.getBoolean("terminal.integrated.neverMeasureRenderTime" , -1 , false);
|
|
548
|
+
if (!neverMeasureRenderTime && this._configHelper.config.gpuAcceleration !== 'off') {
|
|
549
|
+
this._measureRenderTime();
|
|
550
|
+
}
|
|
551
|
+
this._disableWebglForThisSession();
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
_disableWebglForThisSession() {
|
|
555
|
+
XtermTerminal_1._suggestedRendererType = 'canvas';
|
|
556
|
+
this._disposeOfWebglRenderer();
|
|
557
|
+
this._enableCanvasRenderer();
|
|
558
|
+
}
|
|
559
|
+
async _enableCanvasRenderer() {
|
|
560
|
+
if (!this.raw.element || this._canvasAddon) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
const Addon = await this._getCanvasAddonConstructor();
|
|
564
|
+
this._canvasAddon = ( new Addon());
|
|
565
|
+
this._disposeOfWebglRenderer();
|
|
566
|
+
try {
|
|
567
|
+
this.raw.loadAddon(this._canvasAddon);
|
|
568
|
+
this._logService.trace('Canvas renderer was loaded');
|
|
569
|
+
}
|
|
570
|
+
catch (e) {
|
|
571
|
+
this._logService.warn(`Canvas renderer could not be loaded, falling back to dom renderer`, e);
|
|
572
|
+
const neverMeasureRenderTime = this._storageService.getBoolean("terminal.integrated.neverMeasureRenderTime" , -1 , false);
|
|
573
|
+
if (!neverMeasureRenderTime && this._configHelper.config.gpuAcceleration !== 'off') {
|
|
574
|
+
this._measureRenderTime();
|
|
575
|
+
}
|
|
576
|
+
XtermTerminal_1._suggestedRendererType = 'dom';
|
|
577
|
+
this._disposeOfCanvasRenderer();
|
|
578
|
+
}
|
|
579
|
+
this._refreshImageAddon();
|
|
580
|
+
}
|
|
581
|
+
async _getCanvasAddonConstructor() {
|
|
582
|
+
if (!CanvasAddon) {
|
|
583
|
+
CanvasAddon = (await import('@xterm/addon-canvas').then(module => module.default ?? module)).CanvasAddon;
|
|
584
|
+
}
|
|
585
|
+
return CanvasAddon;
|
|
586
|
+
}
|
|
587
|
+
async _refreshImageAddon() {
|
|
588
|
+
if (this._configHelper.config.enableImages && (this._canvasAddon || this._webglAddon)) {
|
|
589
|
+
if (!this._imageAddon) {
|
|
590
|
+
const AddonCtor = await this._getImageAddonConstructor();
|
|
591
|
+
this._imageAddon = ( new AddonCtor());
|
|
592
|
+
this.raw.loadAddon(this._imageAddon);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
try {
|
|
597
|
+
this._imageAddon?.dispose();
|
|
598
|
+
}
|
|
599
|
+
catch {
|
|
600
|
+
}
|
|
601
|
+
this._imageAddon = undefined;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
async _getImageAddonConstructor() {
|
|
605
|
+
if (!ImageAddon) {
|
|
606
|
+
ImageAddon = (await import('@xterm/addon-image').then(module => module.default ?? module)).ImageAddon;
|
|
607
|
+
}
|
|
608
|
+
return ImageAddon;
|
|
609
|
+
}
|
|
610
|
+
async _getSearchAddonConstructor() {
|
|
611
|
+
if (!SearchAddon) {
|
|
612
|
+
SearchAddon = (await import('@xterm/addon-search').then(module => module.default ?? module)).SearchAddon;
|
|
613
|
+
}
|
|
614
|
+
return SearchAddon;
|
|
615
|
+
}
|
|
616
|
+
async _getUnicode11Constructor() {
|
|
617
|
+
if (!Unicode11Addon) {
|
|
618
|
+
Unicode11Addon = (await import('@xterm/addon-unicode11').then(module => module.default ?? module)).Unicode11Addon;
|
|
619
|
+
}
|
|
620
|
+
return Unicode11Addon;
|
|
621
|
+
}
|
|
622
|
+
async _getWebglAddonConstructor() {
|
|
623
|
+
if (!WebglAddon) {
|
|
624
|
+
WebglAddon = (await import('@xterm/addon-webgl').then(module => module.default ?? module)).WebglAddon;
|
|
625
|
+
}
|
|
626
|
+
return WebglAddon;
|
|
627
|
+
}
|
|
628
|
+
async _getSerializeAddonConstructor() {
|
|
629
|
+
if (!SerializeAddon) {
|
|
630
|
+
SerializeAddon = (await import('@xterm/addon-serialize').then(module => module.default ?? module)).SerializeAddon;
|
|
631
|
+
}
|
|
632
|
+
return SerializeAddon;
|
|
633
|
+
}
|
|
634
|
+
_disposeOfCanvasRenderer() {
|
|
635
|
+
try {
|
|
636
|
+
this._canvasAddon?.dispose();
|
|
637
|
+
}
|
|
638
|
+
catch {
|
|
639
|
+
}
|
|
640
|
+
this._canvasAddon = undefined;
|
|
641
|
+
this._refreshImageAddon();
|
|
642
|
+
}
|
|
643
|
+
_disposeOfWebglRenderer() {
|
|
644
|
+
try {
|
|
645
|
+
this._webglAddon?.dispose();
|
|
646
|
+
}
|
|
647
|
+
catch {
|
|
648
|
+
}
|
|
649
|
+
this._webglAddon = undefined;
|
|
650
|
+
this._refreshImageAddon();
|
|
651
|
+
}
|
|
652
|
+
async _measureRenderTime() {
|
|
653
|
+
const frameTimes = [];
|
|
654
|
+
if (!this._core._renderService?._renderer.value?._renderLayers) {
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
const textRenderLayer = this._core._renderService._renderer.value._renderLayers[0];
|
|
658
|
+
const originalOnGridChanged = textRenderLayer?.onGridChanged;
|
|
659
|
+
const evaluateCanvasRenderer = () => {
|
|
660
|
+
frameTimes.shift();
|
|
661
|
+
const medianTime = frameTimes.sort((a, b) => a - b)[Math.floor(frameTimes.length / 2)];
|
|
662
|
+
if (medianTime > 50 ) {
|
|
663
|
+
if (this._configHelper.config.gpuAcceleration === 'auto') {
|
|
664
|
+
XtermTerminal_1._suggestedRendererType = 'dom';
|
|
665
|
+
this.updateConfig();
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
const promptChoices = [
|
|
669
|
+
{
|
|
670
|
+
label: ( localizeWithPath('vs/workbench/contrib/terminal/browser/xterm/xtermTerminal', 'yes', "Yes")),
|
|
671
|
+
run: () => this._configurationService.updateValue("terminal.integrated.gpuAcceleration" , 'off', 2 )
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
label: ( localizeWithPath('vs/workbench/contrib/terminal/browser/xterm/xtermTerminal', 'no', "No")),
|
|
675
|
+
run: () => { }
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
label: ( localizeWithPath(
|
|
679
|
+
'vs/workbench/contrib/terminal/browser/xterm/xtermTerminal',
|
|
680
|
+
'dontShowAgain',
|
|
681
|
+
"Don't Show Again"
|
|
682
|
+
)),
|
|
683
|
+
isSecondary: true,
|
|
684
|
+
run: () => this._storageService.store("terminal.integrated.neverMeasureRenderTime" , true, -1 , 1 )
|
|
685
|
+
}
|
|
686
|
+
];
|
|
687
|
+
this._notificationService.prompt(Severity.Warning, ( localizeWithPath(
|
|
688
|
+
'vs/workbench/contrib/terminal/browser/xterm/xtermTerminal',
|
|
689
|
+
'terminal.slowRendering',
|
|
690
|
+
'Terminal GPU acceleration appears to be slow on your computer. Would you like to switch to disable it which may improve performance? [Read more about terminal settings](https://code.visualstudio.com/docs/editor/integrated-terminal#_changing-how-the-terminal-is-rendered).'
|
|
691
|
+
)), promptChoices);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
textRenderLayer.onGridChanged = (terminal, firstRow, lastRow) => {
|
|
696
|
+
const startTime = performance.now();
|
|
697
|
+
originalOnGridChanged.call(textRenderLayer, terminal, firstRow, lastRow);
|
|
698
|
+
frameTimes.push(performance.now() - startTime);
|
|
699
|
+
if (frameTimes.length === 20 ) {
|
|
700
|
+
evaluateCanvasRenderer();
|
|
701
|
+
textRenderLayer.onGridChanged = originalOnGridChanged;
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
getXtermTheme(theme) {
|
|
706
|
+
if (!theme) {
|
|
707
|
+
theme = this._themeService.getColorTheme();
|
|
708
|
+
}
|
|
709
|
+
const foregroundColor = theme.getColor(TERMINAL_FOREGROUND_COLOR);
|
|
710
|
+
const backgroundColor = this._xtermColorProvider.getBackgroundColor(theme);
|
|
711
|
+
const cursorColor = theme.getColor(TERMINAL_CURSOR_FOREGROUND_COLOR) || foregroundColor;
|
|
712
|
+
const cursorAccentColor = theme.getColor(TERMINAL_CURSOR_BACKGROUND_COLOR) || backgroundColor;
|
|
713
|
+
const selectionBackgroundColor = theme.getColor(TERMINAL_SELECTION_BACKGROUND_COLOR);
|
|
714
|
+
const selectionInactiveBackgroundColor = theme.getColor(TERMINAL_INACTIVE_SELECTION_BACKGROUND_COLOR);
|
|
715
|
+
const selectionForegroundColor = theme.getColor(TERMINAL_SELECTION_FOREGROUND_COLOR) || undefined;
|
|
716
|
+
return {
|
|
717
|
+
background: backgroundColor?.toString(),
|
|
718
|
+
foreground: foregroundColor?.toString(),
|
|
719
|
+
cursor: cursorColor?.toString(),
|
|
720
|
+
cursorAccent: cursorAccentColor?.toString(),
|
|
721
|
+
selectionBackground: selectionBackgroundColor?.toString(),
|
|
722
|
+
selectionInactiveBackground: selectionInactiveBackgroundColor?.toString(),
|
|
723
|
+
selectionForeground: selectionForegroundColor?.toString(),
|
|
724
|
+
black: theme.getColor(ansiColorIdentifiers[0])?.toString(),
|
|
725
|
+
red: theme.getColor(ansiColorIdentifiers[1])?.toString(),
|
|
726
|
+
green: theme.getColor(ansiColorIdentifiers[2])?.toString(),
|
|
727
|
+
yellow: theme.getColor(ansiColorIdentifiers[3])?.toString(),
|
|
728
|
+
blue: theme.getColor(ansiColorIdentifiers[4])?.toString(),
|
|
729
|
+
magenta: theme.getColor(ansiColorIdentifiers[5])?.toString(),
|
|
730
|
+
cyan: theme.getColor(ansiColorIdentifiers[6])?.toString(),
|
|
731
|
+
white: theme.getColor(ansiColorIdentifiers[7])?.toString(),
|
|
732
|
+
brightBlack: theme.getColor(ansiColorIdentifiers[8])?.toString(),
|
|
733
|
+
brightRed: theme.getColor(ansiColorIdentifiers[9])?.toString(),
|
|
734
|
+
brightGreen: theme.getColor(ansiColorIdentifiers[10])?.toString(),
|
|
735
|
+
brightYellow: theme.getColor(ansiColorIdentifiers[11])?.toString(),
|
|
736
|
+
brightBlue: theme.getColor(ansiColorIdentifiers[12])?.toString(),
|
|
737
|
+
brightMagenta: theme.getColor(ansiColorIdentifiers[13])?.toString(),
|
|
738
|
+
brightCyan: theme.getColor(ansiColorIdentifiers[14])?.toString(),
|
|
739
|
+
brightWhite: theme.getColor(ansiColorIdentifiers[15])?.toString()
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
_updateTheme(theme) {
|
|
743
|
+
this.raw.options.theme = this.getXtermTheme(theme);
|
|
744
|
+
}
|
|
745
|
+
refresh() {
|
|
746
|
+
this._updateTheme();
|
|
747
|
+
this._decorationAddon.refreshLayouts();
|
|
748
|
+
}
|
|
749
|
+
async _updateUnicodeVersion() {
|
|
750
|
+
if (!this._unicode11Addon && this._configHelper.config.unicodeVersion === '11') {
|
|
751
|
+
const Addon = await this._getUnicode11Constructor();
|
|
752
|
+
this._unicode11Addon = ( new Addon());
|
|
753
|
+
this.raw.loadAddon(this._unicode11Addon);
|
|
754
|
+
}
|
|
755
|
+
if (this.raw.unicode.activeVersion !== this._configHelper.config.unicodeVersion) {
|
|
756
|
+
this.raw.unicode.activeVersion = this._configHelper.config.unicodeVersion;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
_writeText(data) {
|
|
760
|
+
this.raw.write(data);
|
|
761
|
+
}
|
|
762
|
+
dispose() {
|
|
763
|
+
this._anyTerminalFocusContextKey.reset();
|
|
764
|
+
this._anyFocusedTerminalHasSelection.reset();
|
|
765
|
+
this._onDidDispose.fire();
|
|
766
|
+
super.dispose();
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
XtermTerminal.__decorator = ( __decorate([
|
|
770
|
+
debounce(100)
|
|
771
|
+
], XtermTerminal.prototype, "_refreshImageAddon", null));
|
|
772
|
+
XtermTerminal = XtermTerminal_1 = ( __decorate([
|
|
773
|
+
( __param(9, IConfigurationService)),
|
|
774
|
+
( __param(10, IInstantiationService)),
|
|
775
|
+
( __param(11, ITerminalLogService)),
|
|
776
|
+
( __param(12, INotificationService)),
|
|
777
|
+
( __param(13, IStorageService)),
|
|
778
|
+
( __param(14, IThemeService)),
|
|
779
|
+
( __param(15, ITelemetryService)),
|
|
780
|
+
( __param(16, IClipboardService)),
|
|
781
|
+
( __param(17, IContextKeyService)),
|
|
782
|
+
( __param(18, IAccessibleNotificationService)),
|
|
783
|
+
( __param(19, ILayoutService))
|
|
784
|
+
], XtermTerminal));
|
|
785
|
+
function getXtermScaledDimensions(w, font, width, height) {
|
|
786
|
+
if (!font.charWidth || !font.charHeight) {
|
|
787
|
+
return null;
|
|
788
|
+
}
|
|
789
|
+
const scaledWidthAvailable = width * w.devicePixelRatio;
|
|
790
|
+
const scaledCharWidth = font.charWidth * w.devicePixelRatio + font.letterSpacing;
|
|
791
|
+
const cols = Math.max(Math.floor(scaledWidthAvailable / scaledCharWidth), 1);
|
|
792
|
+
const scaledHeightAvailable = height * w.devicePixelRatio;
|
|
793
|
+
const scaledCharHeight = Math.ceil(font.charHeight * w.devicePixelRatio);
|
|
794
|
+
const scaledLineHeight = Math.floor(scaledCharHeight * font.lineHeight);
|
|
795
|
+
const rows = Math.max(Math.floor(scaledHeightAvailable / scaledLineHeight), 1);
|
|
796
|
+
return { rows, cols };
|
|
797
|
+
}
|
|
798
|
+
function vscodeToXtermLogLevel(logLevel) {
|
|
799
|
+
switch (logLevel) {
|
|
800
|
+
case LogLevel.Trace: return 'trace';
|
|
801
|
+
case LogLevel.Debug: return 'debug';
|
|
802
|
+
case LogLevel.Info: return 'info';
|
|
803
|
+
case LogLevel.Warning: return 'warn';
|
|
804
|
+
case LogLevel.Error: return 'error';
|
|
805
|
+
default: return 'off';
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
function vscodeToXtermCursorStyle(style) {
|
|
809
|
+
if (style === 'line') {
|
|
810
|
+
return 'bar';
|
|
811
|
+
}
|
|
812
|
+
return style;
|
|
813
|
+
}
|
|
814
|
+
export { XtermTerminal, getXtermScaledDimensions };
|