@codingame/monaco-vscode-api 9.0.2 → 10.0.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 +2 -0
- package/_virtual/semver.js +3 -2
- package/_virtual/semver2.js +2 -0
- package/api.js +7 -6
- package/debugProtocol.d.ts +10 -1
- package/extensions.d.ts +0 -2
- package/extensions.js +1 -1
- package/external/vscode-semver/semver.js +988 -983
- package/lifecycle.js +4 -7
- package/localExtensionHost.js +11 -7
- package/missing-services.js +126 -42
- package/monaco.js +42 -10
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +1 -1
- package/package.json +15 -8
- package/service-override/textmate.d.ts +1 -0
- package/service-override/tools/editor.js +60 -22
- package/service-override/tools/views.js +34 -19
- package/service-override/treesitter.d.ts +5 -0
- package/services.js +4 -5
- package/tools/injection.js +4 -1
- package/tools.js +4 -2
- package/vscode/src/vs/base/browser/browser.js +1 -2
- package/vscode/src/vs/base/browser/canIUse.js +4 -10
- package/vscode/src/vs/base/browser/dom.js +8 -10
- package/vscode/src/vs/base/browser/domObservable.js +3 -2
- package/vscode/src/vs/base/browser/formattedTextRenderer.js +24 -36
- package/vscode/src/vs/base/browser/keyboardEvent.js +24 -24
- package/vscode/src/vs/base/browser/markdownRenderer.js +8 -12
- package/vscode/src/vs/base/browser/performance.js +18 -24
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +1 -1
- package/vscode/src/vs/base/browser/ui/actionbar/actionbar.js +14 -20
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.d.ts +2 -2
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.js +2 -3
- package/vscode/src/vs/base/browser/ui/button/button.js +5 -6
- package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/contextview/contextview.js +15 -41
- package/vscode/src/vs/base/browser/ui/dialog/dialog.js +12 -13
- package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +2 -4
- package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +3 -4
- package/vscode/src/vs/base/browser/ui/findinput/findInput.js +5 -6
- package/vscode/src/vs/base/browser/ui/findinput/findInputToggles.js +3 -3
- package/vscode/src/vs/base/browser/ui/findinput/replaceInput.js +6 -7
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.js +8 -12
- package/vscode/src/vs/base/browser/ui/icons/iconSelectBox.js +3 -4
- package/vscode/src/vs/base/browser/ui/inputbox/inputBox.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +15 -23
- package/vscode/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/list/list.js +1 -12
- package/vscode/src/vs/base/browser/ui/list/listView.js +9 -17
- package/vscode/src/vs/base/browser/ui/list/listWidget.js +26 -30
- package/vscode/src/vs/base/browser/ui/menu/menu.js +15 -17
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +13 -13
- package/vscode/src/vs/base/browser/ui/resizable/resizable.js +9 -9
- package/vscode/src/vs/base/browser/ui/sash/sash.js +16 -28
- package/vscode/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.js +4 -5
- package/vscode/src/vs/base/browser/ui/scrollbar/scrollableElement.js +3 -3
- package/vscode/src/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js +2 -3
- package/vscode/src/vs/base/browser/ui/scrollbar/verticalScrollbar.js +2 -3
- package/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.js +21 -23
- package/vscode/src/vs/base/browser/ui/selectBox/selectBoxNative.js +2 -3
- package/vscode/src/vs/base/browser/ui/splitview/paneview.js +23 -25
- package/vscode/src/vs/base/browser/ui/splitview/splitview.js +27 -33
- package/vscode/src/vs/base/browser/ui/table/tableWidget.js +3 -5
- package/vscode/src/vs/base/browser/ui/toggle/toggle.js +1 -2
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.js +3 -3
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +307 -210
- package/vscode/src/vs/base/browser/ui/tree/asyncDataTree.js +395 -22
- package/vscode/src/vs/base/browser/ui/tree/compressedObjectTreeModel.js +25 -32
- package/vscode/src/vs/base/browser/ui/tree/dataTree.js +2 -2
- package/vscode/src/vs/base/browser/ui/tree/indexTreeModel.js +25 -31
- package/vscode/src/vs/base/browser/ui/tree/objectTree.js +9 -5
- package/vscode/src/vs/base/browser/ui/tree/objectTreeModel.js +4 -7
- package/vscode/src/vs/base/browser/ui/tree/tree.js +1 -13
- package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +1 -1
- package/vscode/src/vs/base/common/actions.js +1 -1
- package/vscode/src/vs/base/common/amd.js +10 -27
- package/vscode/src/vs/base/common/arrays.js +1 -7
- package/vscode/src/vs/base/common/async.js +14 -25
- package/vscode/src/vs/base/common/codicons.d.ts +7 -0
- package/vscode/src/vs/base/common/color.d.ts +28 -0
- package/vscode/src/vs/base/common/color.js +71 -24
- package/vscode/src/vs/base/common/date.js +61 -61
- package/vscode/src/vs/base/common/diff/diff.js +10 -15
- package/vscode/src/vs/base/common/errorMessage.js +6 -6
- package/vscode/src/vs/base/common/errors.js +5 -1
- package/vscode/src/vs/base/common/event.d.ts +2 -2
- package/vscode/src/vs/base/common/event.js +23 -1
- package/vscode/src/vs/base/common/extpath.js +8 -9
- package/vscode/src/vs/base/common/filters.js +31 -39
- package/vscode/src/vs/base/common/fuzzyScorer.js +9 -10
- package/vscode/src/vs/base/common/glob.js +1 -2
- package/vscode/src/vs/base/common/hash.js +10 -15
- package/vscode/src/vs/base/common/hotReloadHelpers.js +9 -17
- package/vscode/src/vs/base/common/htmlContent.js +3 -8
- package/vscode/src/vs/base/common/json.js +149 -323
- package/vscode/src/vs/base/common/jsonErrorMessages.js +9 -10
- package/vscode/src/vs/base/common/jsonFormatter.js +30 -30
- package/vscode/src/vs/base/common/keyCodes.js +249 -591
- package/vscode/src/vs/base/common/keybindingLabels.js +23 -24
- package/vscode/src/vs/base/common/keybindings.js +17 -30
- package/vscode/src/vs/base/common/labels.js +11 -12
- package/vscode/src/vs/base/common/map.js +67 -20
- package/vscode/src/vs/base/common/marshalling.js +4 -5
- package/vscode/src/vs/base/common/naturalLanguage/korean.js +129 -213
- package/vscode/src/vs/base/common/network.js +2 -2
- package/vscode/src/vs/base/common/observableInternal/api.js +3 -1
- package/vscode/src/vs/base/common/observableInternal/autorun.js +46 -35
- package/vscode/src/vs/base/common/observableInternal/base.js +3 -1
- package/vscode/src/vs/base/common/observableInternal/derived.js +55 -40
- package/vscode/src/vs/base/common/observableInternal/promise.js +1 -55
- package/vscode/src/vs/base/common/observableInternal/utils.js +41 -5
- package/vscode/src/vs/base/common/observableInternal/utilsCancellation.js +79 -0
- package/vscode/src/vs/base/common/performance.js +1 -3
- package/vscode/src/vs/base/common/platform.js +10 -23
- package/vscode/src/vs/base/common/processes.js +1 -8
- package/vscode/src/vs/base/common/product.d.ts +2 -0
- package/vscode/src/vs/base/common/resources.js +3 -4
- package/vscode/src/vs/base/common/scrollable.js +1 -7
- package/vscode/src/vs/base/common/strings.js +47 -66
- package/vscode/src/vs/base/common/ternarySearchTree.js +39 -54
- package/vscode/src/vs/base/common/uint.js +5 -14
- package/vscode/src/vs/base/common/uri.js +39 -41
- package/vscode/src/vs/base/common/uriIpc.js +1 -2
- package/vscode/src/vs/base/common/worker/simpleWorker.js +13 -22
- package/vscode/src/vs/base/parts/ipc/common/ipc.js +55 -77
- package/vscode/src/vs/base/parts/ipc/common/ipc.net.js +51 -108
- package/vscode/src/vs/editor/browser/config/charWidthReader.js +4 -10
- package/vscode/src/vs/editor/browser/config/editorConfiguration.js +3 -4
- package/vscode/src/vs/editor/browser/config/fontMeasurements.js +21 -21
- package/vscode/src/vs/editor/browser/controller/editContext/clipboardUtils.js +45 -0
- package/vscode/src/vs/editor/browser/controller/editContext/editContextUtils.js +4 -0
- package/vscode/src/vs/editor/browser/controller/editContext/native/nativeEditContext.css.js +4 -0
- package/vscode/src/vs/editor/browser/controller/editContext/native/nativeEditContext.js +315 -0
- package/vscode/src/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js +35 -0
- package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +131 -0
- package/vscode/src/vs/editor/browser/controller/editContext/screenReaderUtils.js +107 -0
- package/vscode/src/vs/editor/browser/controller/{textAreaHandler.css.js → editContext/textArea/textAreaEditContext.css.js} +1 -1
- package/vscode/src/vs/editor/browser/controller/{textAreaHandler.js → editContext/textArea/textAreaEditContext.js} +86 -147
- package/vscode/src/vs/editor/browser/controller/{textAreaInput.js → editContext/textArea/textAreaEditContextInput.js} +23 -43
- package/vscode/src/vs/editor/browser/controller/{textAreaState.js → editContext/textArea/textAreaEditContextState.js} +8 -54
- package/vscode/src/vs/editor/browser/controller/mouseHandler.js +25 -28
- package/vscode/src/vs/editor/browser/controller/mouseTarget.js +51 -69
- package/vscode/src/vs/editor/browser/controller/pointerHandler.js +4 -6
- package/vscode/src/vs/editor/browser/coreCommands.js +203 -220
- package/vscode/src/vs/editor/browser/editorBrowser.js +1 -30
- package/vscode/src/vs/editor/browser/editorExtensions.js +15 -16
- package/vscode/src/vs/editor/browser/gpu/atlas/textureAtlas.js +109 -0
- package/vscode/src/vs/editor/browser/gpu/atlas/textureAtlasPage.js +86 -0
- package/vscode/src/vs/editor/browser/gpu/atlas/textureAtlasShelfAllocator.js +107 -0
- package/vscode/src/vs/editor/browser/gpu/atlas/textureAtlasSlabAllocator.js +258 -0
- package/vscode/src/vs/editor/browser/gpu/bufferDirtyTracker.js +32 -0
- package/vscode/src/vs/editor/browser/gpu/fullFileRenderStrategy.js +160 -0
- package/vscode/src/vs/editor/browser/gpu/fullFileRenderStrategy.wgsl.js +88 -0
- package/vscode/src/vs/editor/browser/gpu/gpuDisposable.js +42 -0
- package/vscode/src/vs/editor/browser/gpu/gpuUtils.js +44 -0
- package/vscode/src/vs/editor/browser/gpu/objectCollectionBuffer.js +117 -0
- package/vscode/src/vs/editor/browser/gpu/raster/glyphRasterizer.js +152 -0
- package/vscode/src/vs/editor/browser/gpu/rectangleRenderer.js +186 -0
- package/vscode/src/vs/editor/browser/gpu/rectangleRenderer.wgsl.js +63 -0
- package/vscode/src/vs/editor/browser/gpu/taskQueue.js +69 -0
- package/vscode/src/vs/editor/browser/gpu/viewGpuContext.js +86 -0
- package/vscode/src/vs/editor/browser/observableCodeEditor.js +7 -39
- package/vscode/src/vs/editor/browser/services/abstractCodeEditorService.js +18 -28
- package/vscode/src/vs/editor/browser/services/editorWorkerService.js +1 -2
- package/vscode/src/vs/editor/browser/services/hoverService/hoverService.js +5 -7
- package/vscode/src/vs/editor/browser/services/hoverService/hoverWidget.js +61 -69
- package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +2 -3
- package/vscode/src/vs/editor/browser/services/markerDecorations.js +2 -2
- package/vscode/src/vs/editor/browser/stableEditorScroll.js +2 -3
- package/vscode/src/vs/editor/browser/view/domLineBreaksComputer.js +21 -27
- package/vscode/src/vs/editor/browser/view/renderingContext.js +4 -3
- package/vscode/src/vs/editor/browser/view/viewController.js +4 -5
- package/vscode/src/vs/editor/browser/view/viewLayer.js +1 -2
- package/vscode/src/vs/editor/browser/view/viewOverlays.js +8 -9
- package/vscode/src/vs/editor/browser/view/viewPart.js +2 -15
- package/vscode/src/vs/editor/browser/view/viewUserInputEvents.js +1 -2
- package/vscode/src/vs/editor/browser/view.js +74 -26
- package/vscode/src/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -2
- package/vscode/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +17 -20
- package/vscode/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +6 -7
- package/vscode/src/vs/editor/browser/viewParts/decorations/decorations.js +2 -3
- package/vscode/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +17 -19
- package/vscode/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +10 -16
- package/vscode/src/vs/editor/browser/viewParts/indentGuides/indentGuides.js +6 -7
- package/vscode/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +8 -9
- package/vscode/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +2 -3
- package/vscode/src/vs/editor/browser/viewParts/margin/margin.js +4 -5
- package/vscode/src/vs/editor/browser/viewParts/minimap/minimap.js +28 -34
- package/vscode/src/vs/editor/browser/viewParts/minimap/minimapCharRenderer.js +9 -9
- package/vscode/src/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.js +22 -22
- package/vscode/src/vs/editor/browser/viewParts/minimap/minimapCharSheet.js +7 -20
- package/vscode/src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +12 -14
- package/vscode/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +19 -37
- package/vscode/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +6 -7
- package/vscode/src/vs/editor/browser/viewParts/rulers/rulers.js +4 -5
- package/vscode/src/vs/editor/browser/viewParts/rulersGpu/rulersGpu.js +57 -0
- package/vscode/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +3 -4
- package/vscode/src/vs/editor/browser/viewParts/selections/selections.js +26 -33
- package/vscode/src/vs/editor/browser/viewParts/viewCursors/viewCursor.js +9 -9
- package/vscode/src/vs/editor/browser/viewParts/viewCursors/viewCursors.js +24 -23
- package/vscode/src/vs/editor/browser/viewParts/{lines → viewLines}/rangeUtil.js +3 -4
- package/vscode/src/vs/editor/browser/viewParts/{lines → viewLines}/viewLine.js +23 -59
- package/vscode/src/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +40 -0
- package/vscode/src/vs/editor/browser/viewParts/{lines → viewLines}/viewLines.js +33 -36
- package/vscode/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +299 -0
- package/vscode/src/vs/editor/browser/viewParts/viewZones/viewZones.js +5 -6
- package/vscode/src/vs/editor/browser/viewParts/whitespace/whitespace.js +16 -18
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorContributions.js +11 -12
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +105 -113
- package/vscode/src/vs/editor/browser/widget/codeEditor/editor.css.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/commands.js +17 -19
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +40 -40
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js +3 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +3 -3
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorSash.js +7 -6
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +15 -17
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +13 -16
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +10 -10
- package/vscode/src/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.js +18 -19
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +13 -12
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +14 -18
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +29 -30
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +52 -53
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +25 -27
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +7 -6
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +4 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +5 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.js +4 -3
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +3 -2
- package/vscode/src/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer.js +5 -3
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +8 -7
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.js +16 -8
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.js +9 -10
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +26 -15
- package/vscode/src/vs/editor/common/commands/replaceCommand.js +2 -2
- package/vscode/src/vs/editor/common/commands/shiftCommand.js +5 -6
- package/vscode/src/vs/editor/common/commands/trimTrailingWhitespaceCommand.js +1 -2
- package/vscode/src/vs/editor/common/config/editorConfigurationSchema.js +64 -52
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +15 -0
- package/vscode/src/vs/editor/common/config/editorOptions.js +619 -732
- package/vscode/src/vs/editor/common/config/fontInfo.js +8 -8
- package/vscode/src/vs/editor/common/core/characterClassifier.js +3 -8
- package/vscode/src/vs/editor/common/core/cursorColumns.js +4 -5
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +72 -72
- package/vscode/src/vs/editor/common/core/eolCounter.js +8 -16
- package/vscode/src/vs/editor/common/core/offsetEdit.js +248 -0
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +2 -0
- package/vscode/src/vs/editor/common/core/offsetRange.js +8 -0
- package/vscode/src/vs/editor/common/core/selection.js +7 -12
- package/vscode/src/vs/editor/common/core/textEdit.d.ts +22 -1
- package/vscode/src/vs/editor/common/core/textEdit.js +49 -3
- package/vscode/src/vs/editor/common/core/textLength.d.ts +2 -0
- package/vscode/src/vs/editor/common/core/textLength.js +6 -0
- package/vscode/src/vs/editor/common/core/wordCharacterClassifier.js +5 -12
- package/vscode/src/vs/editor/common/cursor/cursor.js +31 -34
- package/vscode/src/vs/editor/common/cursor/cursorAtomicMoveOperations.js +10 -17
- package/vscode/src/vs/editor/common/cursor/cursorColumnSelection.js +3 -3
- package/vscode/src/vs/editor/common/cursor/cursorDeleteOperations.js +4 -4
- package/vscode/src/vs/editor/common/cursor/cursorMoveCommands.js +50 -52
- package/vscode/src/vs/editor/common/cursor/cursorMoveOperations.js +12 -14
- package/vscode/src/vs/editor/common/cursor/cursorTypeEditOperations.js +32 -34
- package/vscode/src/vs/editor/common/cursor/cursorTypeOperations.js +2 -2
- package/vscode/src/vs/editor/common/cursor/cursorWordOperations.js +65 -79
- package/vscode/src/vs/editor/common/cursor/oneCursor.js +6 -7
- package/vscode/src/vs/editor/common/cursorCommon.js +38 -54
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js +0 -1
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +8 -58
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.js +1 -2
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js +30 -43
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/utils.js +1 -2
- package/vscode/src/vs/editor/common/diff/legacyLinesDiffComputer.js +4 -5
- package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +5 -1
- package/vscode/src/vs/editor/common/diff/rangeMapping.js +80 -1
- package/vscode/src/vs/editor/common/editorCommon.js +1 -16
- package/vscode/src/vs/editor/common/editorContextKeys.js +46 -47
- package/vscode/src/vs/editor/common/encodedTokenAttributes.js +19 -71
- package/vscode/src/vs/editor/common/languages/autoIndent.js +6 -8
- package/vscode/src/vs/editor/common/languages/languageConfiguration.js +7 -9
- package/vscode/src/vs/editor/common/languages/languageConfigurationRegistry.js +2 -2
- package/vscode/src/vs/editor/common/languages/linkComputer.js +69 -94
- package/vscode/src/vs/editor/common/languages/modesRegistry.js +1 -1
- package/vscode/src/vs/editor/common/languages/nullTokenize.js +5 -6
- package/vscode/src/vs/editor/common/languages/supports/indentRules.js +5 -12
- package/vscode/src/vs/editor/common/languages/supports/indentationLineProcessor.js +3 -4
- package/vscode/src/vs/editor/common/languages/supports/onEnter.js +3 -4
- package/vscode/src/vs/editor/common/languages/supports/tokenization.js +24 -25
- package/vscode/src/vs/editor/common/languages/supports.js +1 -6
- package/vscode/src/vs/editor/common/languages/textToHtmlTokenizer.js +12 -14
- package/vscode/src/vs/editor/common/languages.d.ts +23 -3
- package/vscode/src/vs/editor/common/languages.js +119 -205
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.js +10 -18
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.js +16 -18
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.js +4 -4
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.js +3 -3
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser.js +7 -8
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.js +33 -15
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/fixBrackets.js +4 -5
- package/vscode/src/vs/editor/common/model/editStack.js +5 -7
- package/vscode/src/vs/editor/common/model/indentationGuesser.js +6 -7
- package/vscode/src/vs/editor/common/model/intervalTree.js +71 -119
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js +16 -17
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js +11 -11
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js +3 -5
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.js +41 -46
- package/vscode/src/vs/editor/common/model/textModel.js +27 -35
- package/vscode/src/vs/editor/common/model/textModelSearch.js +14 -15
- package/vscode/src/vs/editor/common/model/textModelText.js +3 -0
- package/vscode/src/vs/editor/common/model/textModelTokens.js +18 -16
- package/vscode/src/vs/editor/common/model/tokenizationTextModelPart.js +10 -14
- package/vscode/src/vs/editor/common/model/tokens.js +1 -2
- package/vscode/src/vs/editor/common/model/treeSitterTokens.js +10 -4
- package/vscode/src/vs/editor/common/model/utils.js +2 -3
- package/vscode/src/vs/editor/common/model.d.ts +5 -0
- package/vscode/src/vs/editor/common/model.js +1 -46
- package/vscode/src/vs/editor/common/modelLineProjectionData.js +10 -10
- package/vscode/src/vs/editor/common/services/editorBaseApi.js +5 -5
- package/vscode/src/vs/editor/common/services/languageFeatureDebounce.js +2 -2
- package/vscode/src/vs/editor/common/services/languageFeaturesService.js +2 -2
- package/vscode/src/vs/editor/common/services/languageService.js +4 -4
- package/vscode/src/vs/editor/common/services/languagesRegistry.js +3 -4
- package/vscode/src/vs/editor/common/services/markerDecorationsService.js +18 -19
- package/vscode/src/vs/editor/common/services/modelService.js +8 -9
- package/vscode/src/vs/editor/common/services/semanticTokensDto.js +3 -8
- package/vscode/src/vs/editor/common/services/semanticTokensProviderStyling.js +15 -27
- package/vscode/src/vs/editor/common/services/semanticTokensStylingService.js +2 -2
- package/vscode/src/vs/editor/common/services/treeSitterParserService.js +2 -1
- package/vscode/src/vs/editor/common/services/treeViewsDndService.js +2 -2
- package/vscode/src/vs/editor/common/services/unicodeTextModelHighlighter.js +18 -31
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +116 -114
- package/vscode/src/vs/editor/common/standaloneStrings.js +32 -32
- package/vscode/src/vs/editor/common/textModelEvents.js +6 -14
- package/vscode/src/vs/editor/common/tokenizationRegistry.js +2 -3
- package/vscode/src/vs/editor/common/tokenizationTextModelPart.js +13 -6
- package/vscode/src/vs/editor/common/tokens/contiguousTokensStore.js +7 -7
- package/vscode/src/vs/editor/common/tokens/lineTokens.d.ts +10 -7
- package/vscode/src/vs/editor/common/tokens/lineTokens.js +48 -33
- package/vscode/src/vs/editor/common/tokens/sparseMultilineTokens.js +4 -5
- package/vscode/src/vs/editor/common/tokens/sparseTokensStore.js +6 -7
- package/vscode/src/vs/editor/common/tokens/tokenArray.d.ts +25 -0
- package/vscode/src/vs/editor/common/tokens/tokenArray.js +53 -0
- package/vscode/src/vs/editor/common/viewEventHandler.js +18 -19
- package/vscode/src/vs/editor/common/viewEvents.js +19 -50
- package/vscode/src/vs/editor/common/viewLayout/lineDecorations.js +6 -9
- package/vscode/src/vs/editor/common/viewLayout/linePart.js +3 -12
- package/vscode/src/vs/editor/common/viewLayout/viewLayout.js +23 -25
- package/vscode/src/vs/editor/common/viewLayout/viewLineRenderer.js +74 -99
- package/vscode/src/vs/editor/common/viewModel/minimapTokensColorTracker.js +2 -3
- package/vscode/src/vs/editor/common/viewModel/modelLineProjection.js +23 -7
- package/vscode/src/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +19 -30
- package/vscode/src/vs/editor/common/viewModel/overviewZoneManager.js +1 -5
- package/vscode/src/vs/editor/common/viewModel/viewModelDecorations.js +9 -11
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +41 -45
- package/vscode/src/vs/editor/common/viewModel/viewModelLines.js +8 -15
- package/vscode/src/vs/editor/common/viewModel.js +2 -9
- package/vscode/src/vs/editor/common/viewModelEventDispatcher.js +14 -30
- package/vscode/src/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +16 -18
- package/vscode/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +18 -21
- package/vscode/src/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/vscode/src/vs/editor/contrib/caretOperations/browser/transpose.js +3 -5
- package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +47 -44
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +3 -4
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionCommands.js +45 -47
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionContributions.js +10 -10
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +14 -16
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver.js +2 -2
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionMenu.js +11 -12
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +18 -20
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +28 -31
- package/vscode/src/vs/editor/contrib/codeAction/common/types.js +4 -10
- package/vscode/src/vs/editor/contrib/codelens/browser/codeLensCache.js +6 -6
- package/vscode/src/vs/editor/contrib/codelens/browser/codelensController.js +14 -15
- package/vscode/src/vs/editor/contrib/codelens/browser/codelensWidget.js +2 -4
- package/vscode/src/vs/editor/contrib/colorPicker/browser/color.js +2 -23
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorDetector.js +6 -9
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerContribution.js +42 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParticipantUtils.js +51 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerBody.js +71 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +28 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +75 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerInsertButton.js +21 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerSaturationBox.js +101 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerStrip.js +92 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.js +1 -3
- package/vscode/src/vs/editor/contrib/colorPicker/browser/{colorContributions.js → hoverColorPicker/hoverColorPickerContribution.js} +9 -17
- package/vscode/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +131 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerWidget.js +30 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/{standaloneColorPickerActions.js → standaloneColorPicker/standaloneColorPickerActions.js} +17 -23
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerController.js +48 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +115 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/{standaloneColorPickerWidget.js → standaloneColorPicker/standaloneColorPickerWidget.js} +22 -69
- package/vscode/src/vs/editor/contrib/comment/browser/blockCommentCommand.js +4 -5
- package/vscode/src/vs/editor/contrib/comment/browser/comment.js +22 -24
- package/vscode/src/vs/editor/contrib/comment/browser/lineCommentCommand.js +12 -20
- package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +28 -33
- package/vscode/src/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +6 -8
- package/vscode/src/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +4 -4
- package/vscode/src/vs/editor/contrib/dnd/browser/dnd.js +12 -17
- package/vscode/src/vs/editor/contrib/documentSymbols/browser/outlineModel.js +2 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +9 -11
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +19 -20
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js +9 -11
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +6 -7
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +4 -6
- package/vscode/src/vs/editor/contrib/editorState/browser/editorState.js +9 -16
- package/vscode/src/vs/editor/contrib/editorState/browser/keybindingCancellation.js +5 -7
- package/vscode/src/vs/editor/contrib/find/browser/findController.js +101 -111
- package/vscode/src/vs/editor/contrib/find/browser/findDecorations.js +8 -8
- package/vscode/src/vs/editor/contrib/find/browser/findModel.js +25 -31
- package/vscode/src/vs/editor/contrib/find/browser/findOptionsWidget.js +1 -2
- package/vscode/src/vs/editor/contrib/find/browser/findState.js +11 -17
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +71 -72
- package/vscode/src/vs/editor/contrib/find/browser/replacePattern.js +19 -25
- package/vscode/src/vs/editor/contrib/folding/browser/folding.js +111 -89
- package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +22 -23
- package/vscode/src/vs/editor/contrib/folding/browser/foldingModel.js +6 -6
- package/vscode/src/vs/editor/contrib/folding/browser/foldingRanges.js +14 -20
- package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/vscode/src/vs/editor/contrib/format/browser/format.js +12 -23
- package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +19 -21
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoError.js +22 -25
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +19 -22
- package/vscode/src/vs/editor/contrib/gotoError/browser/markerNavigationService.js +2 -2
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +79 -80
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +7 -9
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +8 -10
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +31 -34
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +7 -11
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +14 -10
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +11 -13
- package/vscode/src/vs/editor/contrib/gpu/browser/gpuActions.js +119 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverComputer.js +8 -21
- package/vscode/src/vs/editor/contrib/hover/browser/{contentHoverController2.js → contentHoverController.js} +9 -12
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverRendered.js +10 -9
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverTypes.js +8 -8
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverWidget.js +11 -15
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +31 -39
- package/vscode/src/vs/editor/contrib/hover/browser/{marginHoverComputer.js → glyphHoverComputer.js} +6 -20
- package/vscode/src/vs/editor/contrib/hover/browser/{marginHoverController.js → glyphHoverController.js} +23 -25
- package/vscode/src/vs/editor/contrib/hover/browser/{marginHoverWidget.js → glyphHoverWidget.js} +30 -33
- package/vscode/src/vs/editor/contrib/hover/browser/hover.css.js +1 -1
- package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +12 -12
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +50 -54
- package/vscode/src/vs/editor/contrib/hover/browser/hoverContribution.js +5 -5
- package/vscode/src/vs/editor/contrib/hover/browser/hoverOperation.js +64 -66
- package/vscode/src/vs/editor/contrib/hover/browser/hoverTypes.js +7 -12
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +21 -19
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +11 -13
- package/vscode/src/vs/editor/contrib/hover/browser/resizableContentWidget.js +4 -6
- package/vscode/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +13 -12
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +27 -30
- package/vscode/src/vs/editor/contrib/indentation/common/indentation.js +1 -2
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsContribution.js +2 -2
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +101 -42
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +10 -12
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +2 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +88 -35
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +14 -7
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +96 -54
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +12 -13
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +15 -17
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +10 -6
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.js +3 -4
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/{singleTextEdit.js → computeGhostText.js} +3 -23
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +94 -47
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +63 -21
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +12 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineEditsAdapter.js +83 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +6 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/singleTextEditHelpers.js +25 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdaptor.js +3 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/utils.js +44 -19
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/{ghostTextView.css.js → ghostText/ghostTextView.css.js} +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +295 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.css.js +4 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +357 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils.js +70 -0
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/commands.js +10 -12
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.js +20 -14
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEdit.contribution.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.js +21 -17
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.js +6 -8
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditSideBySideWidget.js +6 -6
- package/vscode/src/vs/editor/contrib/inlineProgress/browser/inlineProgress.js +4 -7
- package/vscode/src/vs/editor/contrib/lineSelection/browser/lineSelection.js +4 -7
- package/vscode/src/vs/editor/contrib/linesOperations/browser/copyLinesCommand.js +2 -2
- package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +63 -65
- package/vscode/src/vs/editor/contrib/linesOperations/browser/moveLinesCommand.js +2 -4
- package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +12 -16
- package/vscode/src/vs/editor/contrib/links/browser/links.js +20 -23
- package/vscode/src/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +4 -6
- package/vscode/src/vs/editor/contrib/message/browser/messageController.js +10 -15
- package/vscode/src/vs/editor/contrib/multicursor/browser/multicursor.js +73 -75
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHints.js +14 -16
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +16 -18
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +8 -9
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +24 -25
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +3 -3
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.js +7 -7
- package/vscode/src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +2 -4
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +8 -10
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +36 -37
- package/vscode/src/vs/editor/contrib/readOnlyMessage/browser/contribution.js +5 -6
- package/vscode/src/vs/editor/contrib/rename/browser/rename.js +31 -33
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +17 -21
- package/vscode/src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +12 -15
- package/vscode/src/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js +2 -2
- package/vscode/src/vs/editor/contrib/smartSelect/browser/smartSelect.js +15 -18
- package/vscode/src/vs/editor/contrib/smartSelect/browser/wordSelections.js +2 -3
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +14 -17
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetParser.js +81 -100
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetSession.js +7 -10
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +16 -18
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollContribution.js +2 -2
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +19 -20
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -2
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -3
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +12 -14
- package/vscode/src/vs/editor/contrib/suggest/browser/completionModel.js +10 -18
- package/vscode/src/vs/editor/contrib/suggest/browser/media/suggest.css.js +1 -1
- package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +24 -32
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestCommitCharacters.js +2 -4
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +79 -93
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +4 -6
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestMemory.js +6 -6
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestModel.js +57 -66
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +101 -98
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +12 -8
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +11 -12
- package/vscode/src/vs/editor/contrib/suggest/browser/wordContextKey.js +2 -3
- package/vscode/src/vs/editor/contrib/suggest/browser/wordDistance.js +2 -4
- package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +8 -10
- package/vscode/src/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +49 -52
- package/vscode/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +11 -12
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +19 -19
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +87 -62
- package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +51 -55
- package/vscode/src/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.js +19 -21
- package/vscode/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.js +9 -12
- package/vscode/src/vs/editor/editor.api.d.ts +3 -0
- package/vscode/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +4 -6
- package/vscode/src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +3 -4
- package/vscode/src/vs/editor/standalone/browser/standaloneCodeEditorService.js +4 -5
- package/vscode/src/vs/editor/standalone/browser/standaloneLayoutService.js +4 -4
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +44 -47
- package/vscode/src/vs/editor/standalone/browser/standaloneThemeService.js +5 -5
- package/vscode/src/vs/editor/standalone/browser/standaloneTreeSitterService.js +4 -0
- package/vscode/src/vs/nls.js +1 -1
- package/vscode/src/vs/platform/accessibility/browser/accessibilityService.js +3 -3
- package/vscode/src/vs/platform/accessibility/browser/accessibleView.js +1 -31
- package/vscode/src/vs/platform/accessibility/common/accessibility.js +1 -7
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +52 -51
- package/vscode/src/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/vscode/src/vs/platform/actionWidget/browser/actionList.js +12 -17
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +21 -23
- package/vscode/src/vs/platform/actions/browser/actionViewItemService.service.js +3 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +3 -3
- package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +7 -6
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +9 -11
- package/vscode/src/vs/platform/actions/browser/toolbar.js +34 -17
- package/vscode/src/vs/platform/actions/common/actions.contribution.js +0 -1
- package/vscode/src/vs/platform/actions/common/actions.d.ts +9 -12
- package/vscode/src/vs/platform/actions/common/actions.js +8 -11
- package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
- package/vscode/src/vs/platform/actions/common/menuService.js +6 -7
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +20 -0
- package/vscode/src/vs/platform/clipboard/common/clipboardService.service.d.ts +5 -0
- package/vscode/src/vs/platform/configuration/common/configuration.js +8 -8
- package/vscode/src/vs/platform/configuration/common/configurationModels.js +3 -4
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +31 -31
- package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +3 -5
- package/vscode/src/vs/platform/contextkey/common/contextkey.js +89 -109
- package/vscode/src/vs/platform/contextkey/common/contextkeys.js +10 -10
- package/vscode/src/vs/platform/contextkey/common/scanner.js +74 -99
- package/vscode/src/vs/platform/contextview/browser/contextView.service.d.ts +2 -2
- package/vscode/src/vs/platform/contextview/browser/contextViewService.js +6 -6
- package/vscode/src/vs/platform/dialogs/common/dialogs.js +9 -9
- package/vscode/src/vs/platform/dialogs/common/dialogs.service.d.ts +1 -1
- package/vscode/src/vs/platform/dnd/browser/dnd.js +1 -1
- package/vscode/src/vs/platform/editor/common/editor.js +1 -14
- package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +8 -9
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +80 -127
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.service.d.ts +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementUtil.js +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionStorage.js +12 -13
- package/vscode/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.js +9 -16
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +35 -35
- package/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +4 -6
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +42 -27
- package/vscode/src/vs/platform/extensions/common/extensions.js +1 -22
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +2 -7
- package/vscode/src/vs/platform/externalServices/common/serviceMachineId.js +2 -3
- package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js +6 -6
- package/vscode/src/vs/platform/files/common/files.js +25 -53
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +10 -10
- package/vscode/src/vs/platform/history/browser/contextScopedHistoryWidget.js +8 -9
- package/vscode/src/vs/platform/hover/browser/hover.js +1 -2
- package/vscode/src/vs/platform/instantiation/common/extensions.js +1 -6
- package/vscode/src/vs/platform/instantiation/common/instantiation.d.ts +1 -1
- package/vscode/src/vs/platform/instantiation/common/instantiationService.js +5 -12
- package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +10 -11
- package/vscode/src/vs/platform/keybinding/common/keybindingResolver.js +9 -15
- package/vscode/src/vs/platform/keybinding/common/keybindingsRegistry.js +4 -12
- package/vscode/src/vs/platform/keybinding/common/resolvedKeybindingItem.js +1 -2
- package/vscode/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js +63 -64
- package/vscode/src/vs/platform/languagePacks/common/languagePacks.js +1 -1
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +3 -3
- package/vscode/src/vs/platform/list/browser/listService.js +31 -38
- package/vscode/src/vs/platform/log/common/bufferLog.js +4 -3
- package/vscode/src/vs/platform/markers/common/markers.js +4 -9
- package/vscode/src/vs/platform/observable/common/platformObservableUtils.js +4 -2
- package/vscode/src/vs/platform/observable/common/wrapInHotClass.js +25 -0
- package/vscode/src/vs/platform/observable/common/wrapInReloadableClass.js +8 -43
- package/vscode/src/vs/platform/opener/browser/link.js +1 -2
- package/vscode/src/vs/platform/product/common/product.js +1 -1
- package/vscode/src/vs/platform/progress/common/progress.js +1 -10
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +16 -17
- package/vscode/src/vs/platform/quickinput/browser/quickInputActions.js +32 -33
- package/vscode/src/vs/platform/quickinput/browser/quickInputBox.js +2 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +10 -11
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +9 -12
- package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +2 -3
- package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +4 -5
- package/vscode/src/vs/platform/quickinput/common/quickInput.js +1 -7
- package/vscode/src/vs/platform/remote/common/remoteAgentConnection.js +15 -29
- package/vscode/src/vs/platform/remote/common/remoteAuthorityResolver.js +3 -8
- package/vscode/src/vs/platform/request/common/request.js +31 -26
- package/vscode/src/vs/platform/storage/common/storage.js +22 -22
- package/vscode/src/vs/platform/telemetry/common/telemetry.js +1 -15
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +12 -12
- package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +41 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.js +345 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.js +296 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +761 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +29 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +22 -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/environmentVariable.js +7 -0
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +196 -0
- package/vscode/src/vs/platform/terminal/common/terminal.js +1 -155
- package/vscode/src/vs/platform/terminal/common/terminalEnvironment.js +40 -0
- package/vscode/src/vs/platform/terminal/common/terminalProfiles.js +107 -0
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +67 -0
- package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +346 -0
- package/vscode/src/vs/platform/theme/common/colorUtils.js +17 -27
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/editorColors.js +93 -93
- package/vscode/src/vs/platform/theme/common/colors/inputColors.js +45 -45
- package/vscode/src/vs/platform/theme/common/colors/listColors.js +36 -36
- package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/vscode/src/vs/platform/theme/common/colors/miscColors.js +8 -8
- package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/vscode/src/vs/platform/theme/common/iconRegistry.js +5 -5
- package/vscode/src/vs/platform/theme/common/tokenClassificationRegistry.js +42 -42
- package/vscode/src/vs/platform/tunnel/common/tunnel.js +1 -3
- package/vscode/src/vs/platform/undoRedo/common/undoRedo.js +1 -6
- package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +44 -49
- package/vscode/src/vs/platform/update/common/update.js +10 -37
- package/vscode/src/vs/platform/uriIdentity/common/uriIdentityService.js +1 -3
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.d.ts +2 -0
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +146 -145
- package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +60 -58
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +14 -81
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +6 -7
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncStoreService.js +48 -49
- package/vscode/src/vs/platform/window/common/window.js +7 -23
- package/vscode/src/vs/platform/workspace/common/workspace.js +2 -8
- package/vscode/src/vs/workbench/api/browser/statusBarService.js +10 -16
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +27 -14
- package/vscode/src/vs/workbench/api/common/extHost.common.services.js +28 -28
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +3 -65
- package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +9 -4
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +56 -29
- package/vscode/src/vs/workbench/api/common/extHostCodeMapper.js +47 -0
- package/vscode/src/vs/workbench/api/common/extHostComments.js +17 -18
- package/vscode/src/vs/workbench/api/common/extHostConfiguration.js +9 -10
- package/vscode/src/vs/workbench/api/common/extHostCustomEditors.js +6 -11
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +45 -36
- package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostEditorTabs.js +19 -19
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +4 -4
- package/vscode/src/vs/workbench/api/common/extHostFileSystem.js +15 -17
- package/vscode/src/vs/workbench/api/common/extHostFileSystemConsumer.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostFileSystemEventService.js +67 -30
- package/vscode/src/vs/workbench/api/common/extHostFileSystemInfo.js +1 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +117 -94
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +46 -9
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +43 -35
- package/vscode/src/vs/workbench/api/common/extHostLogService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +13 -11
- package/vscode/src/vs/workbench/api/common/extHostNotebookEditor.js +11 -6
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +38 -30
- package/vscode/src/vs/workbench/api/common/extHostSearch.js +7 -0
- package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostTask.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +6 -7
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +7 -9
- package/vscode/src/vs/workbench/api/common/extHostTestItem.js +7 -7
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +27 -33
- package/vscode/src/vs/workbench/api/common/extHostTimeline.js +1 -2
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +5 -5
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +218 -193
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +24 -26
- package/vscode/src/vs/workbench/api/common/extHostWebviewMessaging.js +22 -23
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +14 -13
- package/vscode/src/vs/workbench/api/common/extensionHostMain.js +1 -1
- package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +14 -14
- package/vscode/src/vs/workbench/api/worker/extHost.worker.services.js +3 -3
- package/vscode/src/vs/workbench/api/worker/extensionHostWorker.js +4 -4
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +39 -42
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +220 -215
- package/vscode/src/vs/workbench/browser/actions/textInputActions.js +8 -9
- package/vscode/src/vs/workbench/browser/actions/widgetNavigationCommands.js +7 -8
- package/vscode/src/vs/workbench/browser/actions/windowActions.js +46 -47
- package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +37 -38
- package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +4 -4
- package/vscode/src/vs/workbench/browser/codeeditor.js +9 -12
- package/vscode/src/vs/workbench/browser/editor.js +2 -2
- package/vscode/src/vs/workbench/browser/labels.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.d.ts +2 -1
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +19 -22
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +34 -20
- package/vscode/src/vs/workbench/browser/parts/editor/binaryDiffEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/binaryEditor.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbs.js +69 -70
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +44 -45
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +2 -4
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/diffEditorCommands.js +17 -18
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution._autosave.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +316 -323
- package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +27 -30
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +100 -100
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +54 -58
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +14 -15
- package/vscode/src/vs/workbench/browser/parts/editor/editorPane.js +3 -4
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +24 -11
- package/vscode/src/vs/workbench/browser/parts/editor/editorPlaceholder.js +12 -14
- package/vscode/src/vs/workbench/browser/parts/editor/editorQuickAccess.js +11 -12
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +81 -87
- package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +21 -13
- package/vscode/src/vs/workbench/browser/parts/editor/editorsObserver.js +17 -19
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortabscontrol.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +23 -26
- package/vscode/src/vs/workbench/browser/parts/editor/noEditorTabsControl.js +9 -2
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +16 -17
- package/vscode/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.js +4 -4
- package/vscode/src/vs/workbench/browser/parts/editor/textCodeEditor.js +2 -3
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +8 -10
- package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +11 -13
- package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +4 -7
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +25 -30
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +17 -17
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +5 -6
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +14 -16
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +43 -44
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +19 -21
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +10 -14
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +9 -10
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.d.ts +4 -2
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +62 -61
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.d.ts +3 -1
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +57 -61
- package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +16 -23
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +8 -9
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +9 -10
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +18 -16
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +54 -63
- package/vscode/src/vs/workbench/browser/quickaccess.js +1 -1
- package/vscode/src/vs/workbench/browser/window.js +18 -19
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +257 -249
- package/vscode/src/vs/workbench/common/configuration.js +28 -30
- package/vscode/src/vs/workbench/common/contextkeys.js +70 -70
- package/vscode/src/vs/workbench/common/contributions.js +22 -23
- package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +17 -17
- package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +27 -27
- package/vscode/src/vs/workbench/common/editor/editorInput.js +7 -8
- package/vscode/src/vs/workbench/common/editor/editorOptions.js +4 -5
- package/vscode/src/vs/workbench/common/editor/filteredEditorGroupModel.js +6 -7
- package/vscode/src/vs/workbench/common/editor/resourceEditorInput.js +12 -13
- package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +8 -8
- package/vscode/src/vs/workbench/common/editor/textEditorModel.js +3 -4
- package/vscode/src/vs/workbench/common/editor.js +5 -53
- package/vscode/src/vs/workbench/common/memento.js +9 -10
- package/vscode/src/vs/workbench/common/notifications.js +11 -32
- package/vscode/src/vs/workbench/common/theme.js +156 -156
- package/vscode/src/vs/workbench/common/views.js +8 -8
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +170 -197
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +66 -70
- package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +8 -11
- package/vscode/src/vs/workbench/contrib/callHierarchy/common/callHierarchy.js +1 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +161 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +35 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +17 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +51 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.js +11 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.js +78 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +29 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +107 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInvocationPart.js +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.js +206 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditingService.js +751 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImagePaste.js +73 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.js +228 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +469 -103
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +91 -96
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +25 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownRenderer.js +21 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +175 -70
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +46 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatContextAttachments.js +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +532 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatInlineAnchorWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/common/annotations.js +32 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +18 -7
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +34 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +44 -74
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +8 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +2 -5
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +20 -8
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActions.contribution.js +1 -2
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +17 -17
- package/vscode/src/vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint.js +10 -10
- package/vscode/src/vs/workbench/contrib/codeActions/common/documentationExtensionPoint.js +6 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +14 -18
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +10 -11
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +6 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/editorFeatures.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu.js +5 -7
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +17 -14
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +545 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +5 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/menuPreventer.js +4 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +11 -15
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +16 -19
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions.js +2 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +3 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +5 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +19 -22
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/workbenchReferenceSearch.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +24 -6
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +20 -11
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +45 -35
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +14 -10
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +9 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +13 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +4 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +9 -11
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +27 -26
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +33 -22
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +54 -29
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +17 -24
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +39 -28
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +38 -36
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +11 -12
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +13 -9
- package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +1 -2
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +17 -17
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +43 -45
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +46 -47
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +185 -147
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +5 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +370 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +12 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +96 -100
- package/vscode/src/vs/workbench/contrib/debug/browser/debugExpressionRenderer.js +160 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +57 -57
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +21 -17
- package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +6 -6
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +4 -40
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +28 -33
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +2 -3
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +14 -6
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +357 -330
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +24 -24
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +1 -24
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +5 -5
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +3 -4
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +5 -7
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/configuration.js +4 -4
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.js +5 -6
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +3 -4
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +16 -23
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +16 -19
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +2 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +30 -32
- package/vscode/src/vs/workbench/contrib/files/browser/explorerFileContrib.js +2 -6
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +21 -23
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +93 -96
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands._save.js +28 -29
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +44 -46
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +77 -77
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +9 -9
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +3 -3
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +132 -25
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +74 -58
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +43 -49
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +2 -3
- package/vscode/src/vs/workbench/contrib/files/common/explorerFileNestingTrie.js +8 -15
- package/vscode/src/vs/workbench/contrib/files/common/explorerModel.js +3 -5
- package/vscode/src/vs/workbench/contrib/files/common/files.js +16 -39
- package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +4 -5
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +26 -27
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +10 -20
- package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +8 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +77 -71
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +110 -153
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +18 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +19 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +30 -41
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +20 -20
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +19 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +1 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +62 -84
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +4 -5
- package/vscode/src/vs/workbench/contrib/list/browser/list.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
- package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +3 -2
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedGfmHeadingIdPlugin.js +39 -0
- package/vscode/src/vs/workbench/contrib/markers/common/markers.js +2 -7
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +8 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +45 -47
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +3 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +2 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +26 -30
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +8 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +13 -24
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +5 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +32 -31
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +8 -8
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/icons.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +13 -13
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +17 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +12 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +21 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +6 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +17 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +8 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +4 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +37 -48
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +24 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +4 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +347 -127
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +12 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +230 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +59 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +13 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +7 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +148 -37
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +125 -71
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +13 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +36 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +32 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +1 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +18 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +56 -49
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +28 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +13 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +48 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +3 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +26 -35
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +22 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +2 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +8 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +10 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +25 -33
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +8 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +8 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +1 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +2 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +12 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +2 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +4 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +39 -49
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +32 -21
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +85 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +21 -35
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +17 -19
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +4 -7
- package/vscode/src/vs/workbench/contrib/outline/browser/outline.js +2 -8
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +6 -8
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesIcons.js +12 -12
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +32 -36
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsLayout.js +50 -50
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +24 -31
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +6 -4
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +21 -21
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +39 -36
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +17 -17
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +77 -79
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.js +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +45 -49
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +250 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/util.js +131 -0
- package/vscode/src/vs/workbench/contrib/scm/common/scm.js +1 -13
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +11 -12
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +29 -32
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +418 -266
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +11 -11
- package/vscode/src/vs/workbench/contrib/search/common/cellSearchModel.js +2 -3
- package/vscode/src/vs/workbench/contrib/search/common/constants.js +1 -50
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +2 -2
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +8 -9
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +5 -11
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +22 -25
- package/vscode/src/vs/workbench/contrib/snippets/browser/tabCompletion.js +11 -11
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +31 -37
- package/vscode/src/vs/workbench/contrib/tags/browser/workspaceTagsService.js +0 -1
- package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +5 -5
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +5 -5
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +14 -83
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +119 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +1 -27
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +1770 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +40 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +9 -12
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +25 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.js +72 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +16 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +2218 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +8 -9
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +628 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +143 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +61 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +315 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +121 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalUri.js +39 -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 +498 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +123 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +55 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +571 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +732 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/history.js +378 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +62 -165
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalClipboard.js +80 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -23
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +141 -89
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +282 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +28 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/common/terminal.accessibility.js +2 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +46 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +302 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +203 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/find/common/terminal.find.js +9 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.js +97 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +372 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/suggest/common/terminal.suggest.js +9 -20
- package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +3 -4
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +3 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testId.js +18 -29
- package/vscode/src/vs/workbench/contrib/testing/common/testItemCollection.js +41 -51
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +24 -35
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +39 -99
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +14 -15
- package/vscode/src/vs/workbench/contrib/timeline/common/timeline.js +2 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/common/typeHierarchy.js +1 -6
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomainService.js +1 -2
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +9 -10
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.js +2 -9
- package/vscode/src/vs/workbench/contrib/webview/common/webview.js +3 -4
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +3 -4
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput.js +1 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewIconManager.js +1 -2
- package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +2 -2
- package/vscode/src/vs/workbench/services/activity/common/activity.d.ts +10 -1
- package/vscode/src/vs/workbench/services/activity/common/activity.js +29 -6
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +4 -6
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +5 -6
- package/vscode/src/vs/workbench/services/configuration/common/configuration.js +7 -8
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +16 -16
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +1 -1
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +15 -15
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +1 -2
- package/vscode/src/vs/workbench/services/editor/browser/codeEditorService.js +1 -3
- package/vscode/src/vs/workbench/services/editor/browser/editorService.js +26 -29
- package/vscode/src/vs/workbench/services/editor/common/customEditorLabelService.js +0 -1
- package/vscode/src/vs/workbench/services/editor/common/editorGroupColumn.js +5 -5
- package/vscode/src/vs/workbench/services/editor/common/editorGroupFinder.js +5 -5
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.js +2 -2
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +2 -7
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.d.ts +6 -5
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.js +2 -21
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +13 -7
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +6 -7
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +2 -8
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostKind.js +10 -16
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.js +7 -18
- package/vscode/src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.js +0 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocation.js +3 -4
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +7 -18
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +82 -82
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +64 -103
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +20 -36
- package/vscode/src/vs/workbench/services/language/common/languageService.js +29 -30
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +27 -71
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js +8 -28
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycleService.js +11 -11
- package/vscode/src/vs/workbench/services/notebook/common/notebookDocumentService.js +12 -2
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +2 -2
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +7 -7
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +2 -2
- package/vscode/src/vs/workbench/services/progress/browser/progressIndicator.js +18 -20
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +6 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +20 -16
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.service.d.ts +3 -3
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.d.ts +1 -0
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +34 -22
- package/vscode/src/vs/workbench/services/search/common/fileSearchManager.js +11 -7
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +15 -7
- package/vscode/src/vs/workbench/services/search/common/replace.js +11 -12
- package/vscode/src/vs/workbench/services/search/common/search.js +1 -32
- package/vscode/src/vs/workbench/services/search/common/searchExtConversionTypes.js +1 -0
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +3 -3
- package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.js +1 -6
- package/vscode/src/vs/workbench/services/storage/browser/storageService.js +13 -13
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +9 -9
- package/vscode/src/vs/workbench/services/textMate/common/TMHelper.js +107 -0
- package/vscode/src/vs/workbench/services/textfile/common/encoding.js +2 -6
- package/vscode/src/vs/workbench/services/textfile/common/textEditorService.js +0 -1
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +30 -32
- package/vscode/src/vs/workbench/services/textfile/common/textfiles.js +3 -27
- package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +24 -24
- package/vscode/src/vs/workbench/services/themes/common/colorThemeData.js +933 -0
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +15 -15
- package/vscode/src/vs/workbench/services/themes/common/plistParser.js +400 -0
- package/vscode/src/vs/workbench/services/themes/common/textMateScopeMatcher.js +120 -0
- package/vscode/src/vs/workbench/services/themes/common/themeCompatibility.js +76 -0
- package/vscode/src/vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature.service.js +3 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorInput.js +2 -2
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorModel.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/iconSelectBox.js +11 -12
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +3 -3
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +1 -1
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +16 -22
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +51 -43
- package/vscode/src/vs/workbench/services/views/common/viewsService.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +2 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +46 -59
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopy.js +1 -7
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceTrust.js +14 -17
- package/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts +6 -0
- package/vscode-dts/vscode.proposed.aiTextSearchProviderNew.d.ts +5 -0
- package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +30 -3
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +4 -0
- package/vscode-dts/vscode.proposed.contribChatParticipantDetection.d.ts +1 -0
- package/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts +1 -2
- package/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts +8 -2
- package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +1 -1
- package/vscode-dts/vscode.proposed.lmTools.d.ts +47 -9
- package/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts +43 -1
- package/vscode-dts/vscode.proposed.notebookReplDocument.d.ts +17 -4
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +35 -33
- package/workbench.js +3 -1
- package/vscode/src/vs/base/common/charCode.js +0 -296
- package/vscode/src/vs/base/common/hotReload.js +0 -77
- package/vscode/src/vs/base/common/marshallingIds.js +0 -22
- package/vscode/src/vs/editor/common/cursorEvents.js +0 -11
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.js +0 -265
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js +0 -376
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/ghostTextView.js +0 -271
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/commands.js +0 -125
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/consts.js +0 -8
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEdits.contribution.js +0 -9
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsController.js +0 -82
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsModel.js +0 -240
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.css.js +0 -4
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.js +0 -322
- package/vscode/src/vs/platform/label/common/label.js +0 -7
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.js +0 -14
- package/vscode/src/vs/platform/workspace/common/workspaceTrust.js +0 -7
- package/vscode/src/vs/workbench/contrib/accessibility/common/accessibilityCommands.js +0 -16
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +0 -164
- package/vscode/src/vs/workbench/contrib/comments/common/commentCommandIds.js +0 -15
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +0 -271
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatContentWidget.js +0 -175
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatContentWidget.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.js +0 -7
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalMenus.js +0 -720
- package/vscode/src/vs/workbench/contrib/testing/common/constants.js +0 -106
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.js +0 -11
- package/vscode/src/vs/workbench/services/outline/browser/outline.js +0 -22
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopy.js +0 -6
- package/vscode-dts/vscode.proposed.contribSourceControlHistoryItemChangesMenu.d.ts +0 -7
- package/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts +0 -10
- /package/vscode/src/vs/editor/browser/viewParts/{lines → viewLines}/domReadingContext.js +0 -0
- /package/vscode/src/vs/editor/browser/viewParts/{lines → viewLines}/viewLines.css.js +0 -0
|
@@ -0,0 +1,2218 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { isFirefox } from '../../../../base/browser/browser.js';
|
|
3
|
+
import { BrowserFeatures } from '../../../../base/browser/canIUse.js';
|
|
4
|
+
import { DataTransfers } from '../../../../base/browser/dnd.js';
|
|
5
|
+
import { isAncestorOfActiveElement, getWindow, Dimension, addDisposableListener, DragAndDropObserver, getActiveWindow, disposableWindowInterval, isHTMLElement } from '../../../../base/browser/dom.js';
|
|
6
|
+
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
|
|
7
|
+
import { DomScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js';
|
|
8
|
+
import { AutoOpenBarrier, Promises, disposableTimeout, timeout } from '../../../../base/common/async.js';
|
|
9
|
+
import { Codicon } from '../../../../base/common/codicons.js';
|
|
10
|
+
import { debounce } from '../../../../base/common/decorators.js';
|
|
11
|
+
import { onUnexpectedError, ErrorNoTelemetry } from '../../../../base/common/errors.js';
|
|
12
|
+
import { Emitter } from '../../../../base/common/event.js';
|
|
13
|
+
import { template } from '../../../../base/common/labels.js';
|
|
14
|
+
import { Disposable, MutableDisposable, toDisposable, dispose, DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
15
|
+
import { Schemas } from '../../../../base/common/network.js';
|
|
16
|
+
import { win32, basename, resolve } from '../../../../base/common/path.js';
|
|
17
|
+
import { OS, isMacintosh, isWindows } from '../../../../base/common/platform.js';
|
|
18
|
+
import { URI } from '../../../../base/common/uri.js';
|
|
19
|
+
import { TabFocus } from '../../../../editor/browser/config/tabFocus.js';
|
|
20
|
+
import { localize } from '../../../../nls.js';
|
|
21
|
+
import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.service.js';
|
|
22
|
+
import { AccessibilitySignal } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';
|
|
23
|
+
import { IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.service.js';
|
|
24
|
+
import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.service.js';
|
|
25
|
+
import { ICommandService } from '../../../../platform/commands/common/commands.service.js';
|
|
26
|
+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
|
|
27
|
+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.service.js';
|
|
28
|
+
import { containsDragType, CodeDataTransfers } from '../../../../platform/dnd/browser/dnd.js';
|
|
29
|
+
import { IFileService } from '../../../../platform/files/common/files.service.js';
|
|
30
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
31
|
+
import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';
|
|
32
|
+
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.service.js';
|
|
33
|
+
import '../../../../platform/notification/common/notification.js';
|
|
34
|
+
import { INotificationService } from '../../../../platform/notification/common/notification.service.js';
|
|
35
|
+
import { IOpenerService } from '../../../../platform/opener/common/opener.service.js';
|
|
36
|
+
import { IProductService } from '../../../../platform/product/common/productService.service.js';
|
|
37
|
+
import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.service.js';
|
|
38
|
+
import { IStorageService } from '../../../../platform/storage/common/storage.service.js';
|
|
39
|
+
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.service.js';
|
|
40
|
+
import { TerminalCapabilityStoreMultiplexer } from '../../../../platform/terminal/common/capabilities/terminalCapabilityStore.js';
|
|
41
|
+
import { deserializeEnvironmentVariableCollections } from '../../../../platform/terminal/common/environmentVariableShared.js';
|
|
42
|
+
import { TitleEventSource, TerminalExitReason, TerminalLocation } from '../../../../platform/terminal/common/terminal.js';
|
|
43
|
+
import { ITerminalLogService } from '../../../../platform/terminal/common/terminal.service.js';
|
|
44
|
+
import { formatMessageForTerminal } from '../../../../platform/terminal/common/terminalStrings.js';
|
|
45
|
+
import '../../../../platform/theme/common/colorUtils.js';
|
|
46
|
+
import '../../../../platform/theme/common/colors/baseColors.js';
|
|
47
|
+
import '../../../../platform/theme/common/colors/chartsColors.js';
|
|
48
|
+
import { editorBackground } from '../../../../platform/theme/common/colors/editorColors.js';
|
|
49
|
+
import '../../../../platform/theme/common/colors/inputColors.js';
|
|
50
|
+
import '../../../../platform/theme/common/colors/listColors.js';
|
|
51
|
+
import '../../../../platform/theme/common/colors/menuColors.js';
|
|
52
|
+
import '../../../../platform/theme/common/colors/minimapColors.js';
|
|
53
|
+
import '../../../../platform/theme/common/colors/miscColors.js';
|
|
54
|
+
import '../../../../platform/theme/common/colors/quickpickColors.js';
|
|
55
|
+
import '../../../../platform/theme/common/colors/searchColors.js';
|
|
56
|
+
import { getIconRegistry } from '../../../../platform/theme/common/iconRegistry.js';
|
|
57
|
+
import { IThemeService } from '../../../../platform/theme/common/themeService.service.js';
|
|
58
|
+
import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.service.js';
|
|
59
|
+
import { IWorkspaceTrustRequestService } from '../../../../platform/workspace/common/workspaceTrust.service.js';
|
|
60
|
+
import { PANEL_BACKGROUND, SIDE_BAR_BACKGROUND } from '../../../common/theme.js';
|
|
61
|
+
import { IViewDescriptorService } from '../../../common/views.service.js';
|
|
62
|
+
import { IViewsService } from '../../../services/views/common/viewsService.service.js';
|
|
63
|
+
import { ITerminalConfigurationService } from './terminal.service.js';
|
|
64
|
+
import { TerminalLaunchHelpAction } from './terminalActions.js';
|
|
65
|
+
import { TerminalEditorInput } from './terminalEditorInput.js';
|
|
66
|
+
import { TerminalExtensionsRegistry } from './terminalExtensions.js';
|
|
67
|
+
import { getStandardColors, createColorStyleElement, getColorClass } from './terminalIcon.js';
|
|
68
|
+
import { TerminalProcessManager } from './terminalProcessManager.js';
|
|
69
|
+
import { showRunRecentQuickPick } from './terminalRunRecentQuickPick.js';
|
|
70
|
+
import { TerminalStatusList } from './terminalStatusList.js';
|
|
71
|
+
import { getTerminalUri, getTerminalResourcesFromDragEvent } from './terminalUri.js';
|
|
72
|
+
import { TerminalWidgetManager } from './widgets/widgetManager.js';
|
|
73
|
+
import { LineDataEventAddon } from './xterm/lineDataEventAddon.js';
|
|
74
|
+
import { getXtermScaledDimensions, XtermTerminal } from './xterm/xtermTerminal.js';
|
|
75
|
+
import { getDirectoryHistory, getCommandHistory } from '../common/history.js';
|
|
76
|
+
import { TERMINAL_VIEW_ID, TERMINAL_CREATION_COMMANDS, DEFAULT_COMMANDS_TO_SKIP_SHELL } from '../common/terminal.js';
|
|
77
|
+
import { ITerminalProfileResolverService } from '../common/terminal.service.js';
|
|
78
|
+
import { TERMINAL_BACKGROUND_COLOR } from '../common/terminalColorRegistry.js';
|
|
79
|
+
import { TerminalContextKeys } from '../common/terminalContextKey.js';
|
|
80
|
+
import { preparePathForShell, getWorkspaceForTerminal } from '../common/terminalEnvironment.js';
|
|
81
|
+
import { IEditorService } from '../../../services/editor/common/editorService.service.js';
|
|
82
|
+
import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.service.js';
|
|
83
|
+
import { IHistoryService } from '../../../services/history/common/history.service.js';
|
|
84
|
+
import { isHorizontal } from '../../../services/layout/browser/layoutService.js';
|
|
85
|
+
import { IWorkbenchLayoutService } from '../../../services/layout/browser/layoutService.service.js';
|
|
86
|
+
import { IPathService } from '../../../services/path/common/pathService.service.js';
|
|
87
|
+
import { IPreferencesService } from '../../../services/preferences/common/preferences.service.js';
|
|
88
|
+
import { terminalStrings } from '../common/terminalStrings.js';
|
|
89
|
+
import { shouldPasteTerminalText } from '../common/terminalClipboard.js';
|
|
90
|
+
import { TerminalIconPicker } from './terminalIconPicker.js';
|
|
91
|
+
import { IHostService } from '../../../services/host/browser/host.service.js';
|
|
92
|
+
import { TerminalResizeDebouncer } from './terminalResizeDebouncer.js';
|
|
93
|
+
import { openContextMenu } from './terminalContextMenu.js';
|
|
94
|
+
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.service.js';
|
|
95
|
+
import Severity$1 from '../../../../base/common/severity.js';
|
|
96
|
+
var TerminalInstance_1;
|
|
97
|
+
let xtermConstructor;
|
|
98
|
+
const shellIntegrationSupportedShellTypes = [
|
|
99
|
+
"bash" ,
|
|
100
|
+
"zsh" ,
|
|
101
|
+
"pwsh" ,
|
|
102
|
+
"python" ,
|
|
103
|
+
];
|
|
104
|
+
let TerminalInstance = class TerminalInstance extends Disposable {
|
|
105
|
+
static { TerminalInstance_1 = this; }
|
|
106
|
+
static { this._instanceIdCounter = 1; }
|
|
107
|
+
get domElement() { return this._wrapperElement; }
|
|
108
|
+
get usedShellIntegrationInjection() { return this._usedShellIntegrationInjection; }
|
|
109
|
+
pauseInputEvents(barrier) {
|
|
110
|
+
this._pauseInputEventBarrier = barrier;
|
|
111
|
+
}
|
|
112
|
+
get store() {
|
|
113
|
+
return this._store;
|
|
114
|
+
}
|
|
115
|
+
get extEnvironmentVariableCollection() { return this._processManager.extEnvironmentVariableCollection; }
|
|
116
|
+
get waitOnExit() { return this._shellLaunchConfig.attachPersistentProcess?.waitOnExit || this._shellLaunchConfig.waitOnExit; }
|
|
117
|
+
set waitOnExit(value) {
|
|
118
|
+
this._shellLaunchConfig.waitOnExit = value;
|
|
119
|
+
}
|
|
120
|
+
get target() { return this._target; }
|
|
121
|
+
set target(value) {
|
|
122
|
+
this._target = value;
|
|
123
|
+
this._onDidChangeTarget.fire(value);
|
|
124
|
+
}
|
|
125
|
+
get instanceId() { return this._instanceId; }
|
|
126
|
+
get resource() { return this._resource; }
|
|
127
|
+
get cols() {
|
|
128
|
+
if (this._fixedCols !== undefined) {
|
|
129
|
+
return this._fixedCols;
|
|
130
|
+
}
|
|
131
|
+
if (this._dimensionsOverride && this._dimensionsOverride.cols) {
|
|
132
|
+
if (this._dimensionsOverride.forceExactSize) {
|
|
133
|
+
return this._dimensionsOverride.cols;
|
|
134
|
+
}
|
|
135
|
+
return Math.min(Math.max(this._dimensionsOverride.cols, 2), this._cols);
|
|
136
|
+
}
|
|
137
|
+
return this._cols;
|
|
138
|
+
}
|
|
139
|
+
get rows() {
|
|
140
|
+
if (this._fixedRows !== undefined) {
|
|
141
|
+
return this._fixedRows;
|
|
142
|
+
}
|
|
143
|
+
if (this._dimensionsOverride && this._dimensionsOverride.rows) {
|
|
144
|
+
if (this._dimensionsOverride.forceExactSize) {
|
|
145
|
+
return this._dimensionsOverride.rows;
|
|
146
|
+
}
|
|
147
|
+
return Math.min(Math.max(this._dimensionsOverride.rows, 2), this._rows);
|
|
148
|
+
}
|
|
149
|
+
return this._rows;
|
|
150
|
+
}
|
|
151
|
+
get isDisposed() { return this._store.isDisposed; }
|
|
152
|
+
get fixedCols() { return this._fixedCols; }
|
|
153
|
+
get fixedRows() { return this._fixedRows; }
|
|
154
|
+
get maxCols() { return this._cols; }
|
|
155
|
+
get maxRows() { return this._rows; }
|
|
156
|
+
get processId() { return this._processManager.shellProcessId; }
|
|
157
|
+
get processReady() { return this._processManager.ptyProcessReady; }
|
|
158
|
+
get hasChildProcesses() { return this.shellLaunchConfig.attachPersistentProcess?.hasChildProcesses || this._processManager.hasChildProcesses; }
|
|
159
|
+
get reconnectionProperties() { return this.shellLaunchConfig.attachPersistentProcess?.reconnectionProperties || this.shellLaunchConfig.reconnectionProperties; }
|
|
160
|
+
get areLinksReady() { return this._areLinksReady; }
|
|
161
|
+
get initialDataEvents() { return this._initialDataEvents; }
|
|
162
|
+
get exitCode() { return this._exitCode; }
|
|
163
|
+
get exitReason() { return this._exitReason; }
|
|
164
|
+
get hadFocusOnExit() { return this._hadFocusOnExit; }
|
|
165
|
+
get isTitleSetByProcess() { return !!this._messageTitleDisposable.value; }
|
|
166
|
+
get shellLaunchConfig() { return this._shellLaunchConfig; }
|
|
167
|
+
get shellType() { return this._shellType; }
|
|
168
|
+
get os() { return this._processManager.os; }
|
|
169
|
+
get isRemote() { return this._processManager.remoteAuthority !== undefined; }
|
|
170
|
+
get remoteAuthority() { return this._processManager.remoteAuthority; }
|
|
171
|
+
get hasFocus() { return isAncestorOfActiveElement(this._wrapperElement); }
|
|
172
|
+
get title() { return this._title; }
|
|
173
|
+
get titleSource() { return this._titleSource; }
|
|
174
|
+
get icon() { return this._getIcon(); }
|
|
175
|
+
get color() { return this._getColor(); }
|
|
176
|
+
get processName() { return this._processName; }
|
|
177
|
+
get sequence() { return this._sequence; }
|
|
178
|
+
get staticTitle() { return this._staticTitle; }
|
|
179
|
+
get workspaceFolder() { return this._workspaceFolder; }
|
|
180
|
+
get cwd() { return this._cwd; }
|
|
181
|
+
get initialCwd() { return this._initialCwd; }
|
|
182
|
+
get description() {
|
|
183
|
+
if (this._description) {
|
|
184
|
+
return this._description;
|
|
185
|
+
}
|
|
186
|
+
const type = this.shellLaunchConfig.attachPersistentProcess?.type || this.shellLaunchConfig.type;
|
|
187
|
+
switch (type) {
|
|
188
|
+
case 'Task': return terminalStrings.typeTask;
|
|
189
|
+
case 'Local': return terminalStrings.typeLocal;
|
|
190
|
+
default: return undefined;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
get userHome() { return this._userHome; }
|
|
194
|
+
get shellIntegrationNonce() { return this._processManager.shellIntegrationNonce; }
|
|
195
|
+
get injectedArgs() { return this._injectedArgs; }
|
|
196
|
+
constructor(_terminalShellTypeContextKey, _terminalInRunCommandPicker, _shellLaunchConfig, _contextKeyService, _contextMenuService, instantiationService, _terminalConfigurationService, _terminalProfileResolverService, _pathService, _keybindingService, _notificationService, _preferencesService, _viewsService, _clipboardService, _themeService, _configurationService, _logService, _storageService, _accessibilityService, _productService, _quickInputService, workbenchEnvironmentService, _workspaceContextService, _editorService, _workspaceTrustRequestService, _historyService, _telemetryService, _openerService, _commandService, _accessibilitySignalService, _viewDescriptorService) {
|
|
197
|
+
super();
|
|
198
|
+
this._terminalShellTypeContextKey = _terminalShellTypeContextKey;
|
|
199
|
+
this._terminalInRunCommandPicker = _terminalInRunCommandPicker;
|
|
200
|
+
this._shellLaunchConfig = _shellLaunchConfig;
|
|
201
|
+
this._contextKeyService = _contextKeyService;
|
|
202
|
+
this._contextMenuService = _contextMenuService;
|
|
203
|
+
this._terminalConfigurationService = _terminalConfigurationService;
|
|
204
|
+
this._terminalProfileResolverService = _terminalProfileResolverService;
|
|
205
|
+
this._pathService = _pathService;
|
|
206
|
+
this._keybindingService = _keybindingService;
|
|
207
|
+
this._notificationService = _notificationService;
|
|
208
|
+
this._preferencesService = _preferencesService;
|
|
209
|
+
this._viewsService = _viewsService;
|
|
210
|
+
this._clipboardService = _clipboardService;
|
|
211
|
+
this._themeService = _themeService;
|
|
212
|
+
this._configurationService = _configurationService;
|
|
213
|
+
this._logService = _logService;
|
|
214
|
+
this._storageService = _storageService;
|
|
215
|
+
this._accessibilityService = _accessibilityService;
|
|
216
|
+
this._productService = _productService;
|
|
217
|
+
this._quickInputService = _quickInputService;
|
|
218
|
+
this._workspaceContextService = _workspaceContextService;
|
|
219
|
+
this._editorService = _editorService;
|
|
220
|
+
this._workspaceTrustRequestService = _workspaceTrustRequestService;
|
|
221
|
+
this._historyService = _historyService;
|
|
222
|
+
this._telemetryService = _telemetryService;
|
|
223
|
+
this._openerService = _openerService;
|
|
224
|
+
this._commandService = _commandService;
|
|
225
|
+
this._accessibilitySignalService = _accessibilitySignalService;
|
|
226
|
+
this._viewDescriptorService = _viewDescriptorService;
|
|
227
|
+
this._contributions = ( (new Map()));
|
|
228
|
+
this._latestXtermWriteData = 0;
|
|
229
|
+
this._latestXtermParseData = 0;
|
|
230
|
+
this._title = '';
|
|
231
|
+
this._titleSource = TitleEventSource.Process;
|
|
232
|
+
this._cols = 0;
|
|
233
|
+
this._rows = 0;
|
|
234
|
+
this._cwd = undefined;
|
|
235
|
+
this._initialCwd = undefined;
|
|
236
|
+
this._injectedArgs = undefined;
|
|
237
|
+
this._layoutSettingsChanged = true;
|
|
238
|
+
this._areLinksReady = false;
|
|
239
|
+
this._initialDataEventsListener = this._register(( (new MutableDisposable())));
|
|
240
|
+
this._initialDataEvents = [];
|
|
241
|
+
this._messageTitleDisposable = this._register(( (new MutableDisposable())));
|
|
242
|
+
this._dndObserver = this._register(( (new MutableDisposable())));
|
|
243
|
+
this._processName = '';
|
|
244
|
+
this._usedShellIntegrationInjection = false;
|
|
245
|
+
this.capabilities = this._register(( (new TerminalCapabilityStoreMultiplexer())));
|
|
246
|
+
this.disableLayout = false;
|
|
247
|
+
this._onExit = ( (new Emitter()));
|
|
248
|
+
this.onExit = this._onExit.event;
|
|
249
|
+
this._onDisposed = this._register(( (new Emitter())));
|
|
250
|
+
this.onDisposed = this._onDisposed.event;
|
|
251
|
+
this._onProcessIdReady = this._register(( (new Emitter())));
|
|
252
|
+
this.onProcessIdReady = this._onProcessIdReady.event;
|
|
253
|
+
this._onProcessReplayComplete = this._register(( (new Emitter())));
|
|
254
|
+
this.onProcessReplayComplete = this._onProcessReplayComplete.event;
|
|
255
|
+
this._onTitleChanged = this._register(( (new Emitter())));
|
|
256
|
+
this.onTitleChanged = this._onTitleChanged.event;
|
|
257
|
+
this._onIconChanged = this._register(( (new Emitter())));
|
|
258
|
+
this.onIconChanged = this._onIconChanged.event;
|
|
259
|
+
this._onWillData = this._register(( (new Emitter())));
|
|
260
|
+
this.onWillData = this._onWillData.event;
|
|
261
|
+
this._onData = this._register(( (new Emitter())));
|
|
262
|
+
this.onData = this._onData.event;
|
|
263
|
+
this._onBinary = this._register(( (new Emitter())));
|
|
264
|
+
this.onBinary = this._onBinary.event;
|
|
265
|
+
this._onLineData = this._register(( (new Emitter({
|
|
266
|
+
onDidAddFirstListener: () => this._onLineDataSetup()
|
|
267
|
+
}))));
|
|
268
|
+
this.onLineData = this._onLineData.event;
|
|
269
|
+
this._onRequestExtHostProcess = this._register(( (new Emitter())));
|
|
270
|
+
this.onRequestExtHostProcess = this._onRequestExtHostProcess.event;
|
|
271
|
+
this._onDimensionsChanged = this._register(( (new Emitter())));
|
|
272
|
+
this.onDimensionsChanged = this._onDimensionsChanged.event;
|
|
273
|
+
this._onMaximumDimensionsChanged = this._register(( (new Emitter())));
|
|
274
|
+
this.onMaximumDimensionsChanged = this._onMaximumDimensionsChanged.event;
|
|
275
|
+
this._onDidFocus = this._register(( (new Emitter())));
|
|
276
|
+
this.onDidFocus = this._onDidFocus.event;
|
|
277
|
+
this._onDidRequestFocus = this._register(( (new Emitter())));
|
|
278
|
+
this.onDidRequestFocus = this._onDidRequestFocus.event;
|
|
279
|
+
this._onDidBlur = this._register(( (new Emitter())));
|
|
280
|
+
this.onDidBlur = this._onDidBlur.event;
|
|
281
|
+
this._onDidInputData = this._register(( (new Emitter())));
|
|
282
|
+
this.onDidInputData = this._onDidInputData.event;
|
|
283
|
+
this._onDidChangeSelection = this._register(( (new Emitter())));
|
|
284
|
+
this.onDidChangeSelection = this._onDidChangeSelection.event;
|
|
285
|
+
this._onRequestAddInstanceToGroup = this._register(( (new Emitter())));
|
|
286
|
+
this.onRequestAddInstanceToGroup = this._onRequestAddInstanceToGroup.event;
|
|
287
|
+
this._onDidChangeHasChildProcesses = this._register(( (new Emitter())));
|
|
288
|
+
this.onDidChangeHasChildProcesses = this._onDidChangeHasChildProcesses.event;
|
|
289
|
+
this._onDidExecuteText = this._register(( (new Emitter())));
|
|
290
|
+
this.onDidExecuteText = this._onDidExecuteText.event;
|
|
291
|
+
this._onDidChangeTarget = this._register(( (new Emitter())));
|
|
292
|
+
this.onDidChangeTarget = this._onDidChangeTarget.event;
|
|
293
|
+
this._onDidSendText = this._register(( (new Emitter())));
|
|
294
|
+
this.onDidSendText = this._onDidSendText.event;
|
|
295
|
+
this._onDidChangeShellType = this._register(( (new Emitter())));
|
|
296
|
+
this.onDidChangeShellType = this._onDidChangeShellType.event;
|
|
297
|
+
this._onDidChangeVisibility = this._register(( (new Emitter())));
|
|
298
|
+
this.onDidChangeVisibility = this._onDidChangeVisibility.event;
|
|
299
|
+
this._onWillPaste = this._register(( (new Emitter())));
|
|
300
|
+
this.onWillPaste = this._onWillPaste.event;
|
|
301
|
+
this._onDidPaste = this._register(( (new Emitter())));
|
|
302
|
+
this.onDidPaste = this._onDidPaste.event;
|
|
303
|
+
this._overrideCopySelection = undefined;
|
|
304
|
+
this._wrapperElement = document.createElement('div');
|
|
305
|
+
this._wrapperElement.classList.add('terminal-wrapper');
|
|
306
|
+
this._widgetManager = this._register(instantiationService.createInstance(TerminalWidgetManager));
|
|
307
|
+
this._skipTerminalCommands = [];
|
|
308
|
+
this._isExiting = false;
|
|
309
|
+
this._hadFocusOnExit = false;
|
|
310
|
+
this._isVisible = false;
|
|
311
|
+
this._instanceId = TerminalInstance_1._instanceIdCounter++;
|
|
312
|
+
this._hasHadInput = false;
|
|
313
|
+
this._fixedRows = _shellLaunchConfig.attachPersistentProcess?.fixedDimensions?.rows;
|
|
314
|
+
this._fixedCols = _shellLaunchConfig.attachPersistentProcess?.fixedDimensions?.cols;
|
|
315
|
+
this._resource = getTerminalUri(this._workspaceContextService.getWorkspace().id, this.instanceId, this.title);
|
|
316
|
+
if (this._shellLaunchConfig.attachPersistentProcess?.hideFromUser) {
|
|
317
|
+
this._shellLaunchConfig.hideFromUser = this._shellLaunchConfig.attachPersistentProcess.hideFromUser;
|
|
318
|
+
}
|
|
319
|
+
if (this._shellLaunchConfig.attachPersistentProcess?.isFeatureTerminal) {
|
|
320
|
+
this._shellLaunchConfig.isFeatureTerminal = this._shellLaunchConfig.attachPersistentProcess.isFeatureTerminal;
|
|
321
|
+
}
|
|
322
|
+
if (this._shellLaunchConfig.attachPersistentProcess?.type) {
|
|
323
|
+
this._shellLaunchConfig.type = this._shellLaunchConfig.attachPersistentProcess.type;
|
|
324
|
+
}
|
|
325
|
+
if (this.shellLaunchConfig.cwd) {
|
|
326
|
+
const cwdUri = typeof this._shellLaunchConfig.cwd === 'string' ? ( (URI.from({
|
|
327
|
+
scheme: Schemas.file,
|
|
328
|
+
path: this._shellLaunchConfig.cwd
|
|
329
|
+
}))) : this._shellLaunchConfig.cwd;
|
|
330
|
+
if (cwdUri) {
|
|
331
|
+
this._workspaceFolder = this._workspaceContextService.getWorkspaceFolder(cwdUri) ?? undefined;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (!this._workspaceFolder) {
|
|
335
|
+
const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot();
|
|
336
|
+
this._workspaceFolder = activeWorkspaceRootUri ? this._workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) ?? undefined : undefined;
|
|
337
|
+
}
|
|
338
|
+
const scopedContextKeyService = this._register(_contextKeyService.createScoped(this._wrapperElement));
|
|
339
|
+
this._scopedContextKeyService = scopedContextKeyService;
|
|
340
|
+
this._scopedInstantiationService = this._register(instantiationService.createChild(( (new ServiceCollection([IContextKeyService, scopedContextKeyService])))));
|
|
341
|
+
this._terminalFocusContextKey = TerminalContextKeys.focus.bindTo(scopedContextKeyService);
|
|
342
|
+
this._terminalHasFixedWidth = TerminalContextKeys.terminalHasFixedWidth.bindTo(scopedContextKeyService);
|
|
343
|
+
this._terminalHasTextContextKey = TerminalContextKeys.textSelected.bindTo(scopedContextKeyService);
|
|
344
|
+
this._terminalAltBufferActiveContextKey = TerminalContextKeys.altBufferActive.bindTo(scopedContextKeyService);
|
|
345
|
+
this._terminalShellIntegrationEnabledContextKey = TerminalContextKeys.terminalShellIntegrationEnabled.bindTo(scopedContextKeyService);
|
|
346
|
+
this._logService.trace(`terminalInstance#ctor (instanceId: ${this.instanceId})`, this._shellLaunchConfig);
|
|
347
|
+
this._register(this.capabilities.onDidAddCapabilityType(e => {
|
|
348
|
+
this._logService.debug('terminalInstance added capability', e);
|
|
349
|
+
if (e === 0 ) {
|
|
350
|
+
this.capabilities.get(0 )?.onDidChangeCwd(e => {
|
|
351
|
+
this._cwd = e;
|
|
352
|
+
this._setTitle(this.title, TitleEventSource.Config);
|
|
353
|
+
this._scopedInstantiationService.invokeFunction(getDirectoryHistory)?.add(e, { remoteAuthority: this.remoteAuthority });
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
else if (e === 2 ) {
|
|
357
|
+
const commandCapability = this.capabilities.get(2 );
|
|
358
|
+
commandCapability?.onCommandFinished(e => {
|
|
359
|
+
if (e.command.trim().length > 0) {
|
|
360
|
+
this._scopedInstantiationService.invokeFunction(getCommandHistory)?.add(e.command, { shellType: this._shellType });
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}));
|
|
365
|
+
this._register(this.capabilities.onDidRemoveCapabilityType(e => this._logService.debug('terminalInstance removed capability', e)));
|
|
366
|
+
if (!this.shellLaunchConfig.executable && !workbenchEnvironmentService.remoteAuthority) {
|
|
367
|
+
this._terminalProfileResolverService.resolveIcon(this._shellLaunchConfig, OS);
|
|
368
|
+
}
|
|
369
|
+
this._icon = _shellLaunchConfig.attachPersistentProcess?.icon || _shellLaunchConfig.icon;
|
|
370
|
+
if (this.shellLaunchConfig.customPtyImplementation) {
|
|
371
|
+
this._setTitle(this._shellLaunchConfig.name, TitleEventSource.Api);
|
|
372
|
+
}
|
|
373
|
+
this.statusList = this._register(this._scopedInstantiationService.createInstance(TerminalStatusList));
|
|
374
|
+
this._initDimensions();
|
|
375
|
+
this._processManager = this._createProcessManager();
|
|
376
|
+
this._containerReadyBarrier = ( (new AutoOpenBarrier(100 )));
|
|
377
|
+
this._attachBarrier = ( (new AutoOpenBarrier(1000)));
|
|
378
|
+
this._xtermReadyPromise = this._createXterm();
|
|
379
|
+
this._xtermReadyPromise.then(async () => {
|
|
380
|
+
await this._containerReadyBarrier.wait();
|
|
381
|
+
if (!this.shellLaunchConfig.customPtyImplementation && this._terminalConfigurationService.config.shellIntegration?.enabled && !this.shellLaunchConfig.executable) {
|
|
382
|
+
const os = await this._processManager.getBackendOS();
|
|
383
|
+
const defaultProfile = (await this._terminalProfileResolverService.getDefaultProfile({ remoteAuthority: this.remoteAuthority, os }));
|
|
384
|
+
this.shellLaunchConfig.executable = defaultProfile.path;
|
|
385
|
+
this.shellLaunchConfig.args = defaultProfile.args;
|
|
386
|
+
if (this.shellLaunchConfig.isExtensionOwnedTerminal) {
|
|
387
|
+
this.shellLaunchConfig.icon ??= defaultProfile.icon;
|
|
388
|
+
this.shellLaunchConfig.color ??= defaultProfile.color;
|
|
389
|
+
this.shellLaunchConfig.env ??= defaultProfile.env;
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
this.shellLaunchConfig.icon = defaultProfile.icon;
|
|
393
|
+
this.shellLaunchConfig.color = defaultProfile.color;
|
|
394
|
+
this.shellLaunchConfig.env = defaultProfile.env;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
await this._createProcess();
|
|
398
|
+
if (this.shellLaunchConfig.attachPersistentProcess) {
|
|
399
|
+
this._cwd = this.shellLaunchConfig.attachPersistentProcess.cwd;
|
|
400
|
+
this._setTitle(this.shellLaunchConfig.attachPersistentProcess.title, this.shellLaunchConfig.attachPersistentProcess.titleSource);
|
|
401
|
+
this.setShellType(this.shellType);
|
|
402
|
+
}
|
|
403
|
+
if (this._fixedCols) {
|
|
404
|
+
await this._addScrollbar();
|
|
405
|
+
}
|
|
406
|
+
}).catch((err) => {
|
|
407
|
+
if (!this.isDisposed) {
|
|
408
|
+
throw err;
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
this._register(this._configurationService.onDidChangeConfiguration(async (e) => {
|
|
412
|
+
if (e.affectsConfiguration("accessibility.verbosity.terminal" )) {
|
|
413
|
+
this._setAriaLabel(this.xterm?.raw, this._instanceId, this.title);
|
|
414
|
+
}
|
|
415
|
+
if (e.affectsConfiguration('terminal.integrated')) {
|
|
416
|
+
this.updateConfig();
|
|
417
|
+
this.setVisible(this._isVisible);
|
|
418
|
+
}
|
|
419
|
+
const layoutSettings = [
|
|
420
|
+
"terminal.integrated.fontSize" ,
|
|
421
|
+
"terminal.integrated.fontFamily" ,
|
|
422
|
+
"terminal.integrated.fontWeight" ,
|
|
423
|
+
"terminal.integrated.fontWeightBold" ,
|
|
424
|
+
"terminal.integrated.letterSpacing" ,
|
|
425
|
+
"terminal.integrated.lineHeight" ,
|
|
426
|
+
'editor.fontFamily'
|
|
427
|
+
];
|
|
428
|
+
if (( (layoutSettings.some(id => e.affectsConfiguration(id))))) {
|
|
429
|
+
this._layoutSettingsChanged = true;
|
|
430
|
+
await this._resize();
|
|
431
|
+
}
|
|
432
|
+
if (e.affectsConfiguration("terminal.integrated.unicodeVersion" )) {
|
|
433
|
+
this._updateUnicodeVersion();
|
|
434
|
+
}
|
|
435
|
+
if (e.affectsConfiguration('editor.accessibilitySupport')) {
|
|
436
|
+
this.updateAccessibilitySupport();
|
|
437
|
+
}
|
|
438
|
+
if (e.affectsConfiguration("terminal.integrated.tabs.title" ) ||
|
|
439
|
+
e.affectsConfiguration("terminal.integrated.tabs.separator" ) ||
|
|
440
|
+
e.affectsConfiguration("terminal.integrated.tabs.description" )) {
|
|
441
|
+
this._labelComputer?.refreshLabel(this);
|
|
442
|
+
}
|
|
443
|
+
}));
|
|
444
|
+
this._register(this._workspaceContextService.onDidChangeWorkspaceFolders(() => this._labelComputer?.refreshLabel(this)));
|
|
445
|
+
let initialDataEventsTimeout = getWindow(this._container).setTimeout(() => {
|
|
446
|
+
initialDataEventsTimeout = undefined;
|
|
447
|
+
this._initialDataEvents = undefined;
|
|
448
|
+
this._initialDataEventsListener.clear();
|
|
449
|
+
}, 10000);
|
|
450
|
+
this._register(toDisposable(() => {
|
|
451
|
+
if (initialDataEventsTimeout) {
|
|
452
|
+
getWindow(this._container).clearTimeout(initialDataEventsTimeout);
|
|
453
|
+
}
|
|
454
|
+
}));
|
|
455
|
+
const contributionDescs = TerminalExtensionsRegistry.getTerminalContributions();
|
|
456
|
+
for (const desc of contributionDescs) {
|
|
457
|
+
if (( (this._contributions.has(desc.id)))) {
|
|
458
|
+
onUnexpectedError(( (new Error(`Cannot have two terminal contributions with the same id ${desc.id}`))));
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
let contribution;
|
|
462
|
+
try {
|
|
463
|
+
contribution = this._register(this._scopedInstantiationService.createInstance(desc.ctor, this, this._processManager, this._widgetManager));
|
|
464
|
+
this._contributions.set(desc.id, contribution);
|
|
465
|
+
}
|
|
466
|
+
catch (err) {
|
|
467
|
+
onUnexpectedError(err);
|
|
468
|
+
}
|
|
469
|
+
this._xtermReadyPromise.then(xterm => {
|
|
470
|
+
contribution.xtermReady?.(xterm);
|
|
471
|
+
});
|
|
472
|
+
this._register(this.onDisposed(() => {
|
|
473
|
+
contribution.dispose();
|
|
474
|
+
this._contributions.delete(desc.id);
|
|
475
|
+
if ('instance' in contribution) {
|
|
476
|
+
delete contribution.instance;
|
|
477
|
+
}
|
|
478
|
+
if ('_instance' in contribution) {
|
|
479
|
+
delete contribution._instance;
|
|
480
|
+
}
|
|
481
|
+
}));
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
getContribution(id) {
|
|
485
|
+
return this._contributions.get(id);
|
|
486
|
+
}
|
|
487
|
+
_getIcon() {
|
|
488
|
+
if (!this._icon) {
|
|
489
|
+
this._icon = this._processManager.processState >= 2
|
|
490
|
+
? getIconRegistry().getIcon(this._configurationService.getValue("terminal.integrated.tabs.defaultIcon" ))
|
|
491
|
+
: undefined;
|
|
492
|
+
}
|
|
493
|
+
return this._icon;
|
|
494
|
+
}
|
|
495
|
+
_getColor() {
|
|
496
|
+
if (this.shellLaunchConfig.color) {
|
|
497
|
+
return this.shellLaunchConfig.color;
|
|
498
|
+
}
|
|
499
|
+
if (this.shellLaunchConfig?.attachPersistentProcess?.color) {
|
|
500
|
+
return this.shellLaunchConfig.attachPersistentProcess.color;
|
|
501
|
+
}
|
|
502
|
+
if (this._processManager.processState >= 2 ) {
|
|
503
|
+
return undefined;
|
|
504
|
+
}
|
|
505
|
+
return undefined;
|
|
506
|
+
}
|
|
507
|
+
_initDimensions() {
|
|
508
|
+
if (!this._container) {
|
|
509
|
+
this._cols = 80 ;
|
|
510
|
+
this._rows = 30 ;
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
const computedStyle = getWindow(this._container).getComputedStyle(this._container);
|
|
514
|
+
const width = parseInt(computedStyle.width);
|
|
515
|
+
const height = parseInt(computedStyle.height);
|
|
516
|
+
this._evaluateColsAndRows(width, height);
|
|
517
|
+
}
|
|
518
|
+
_evaluateColsAndRows(width, height) {
|
|
519
|
+
if (!width || !height) {
|
|
520
|
+
this._setLastKnownColsAndRows();
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
523
|
+
const dimension = this._getDimension(width, height);
|
|
524
|
+
if (!dimension) {
|
|
525
|
+
this._setLastKnownColsAndRows();
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
const font = this.xterm ? this.xterm.getFont() : this._terminalConfigurationService.getFont(getWindow(this.domElement));
|
|
529
|
+
const newRC = getXtermScaledDimensions(getWindow(this.domElement), font, dimension.width, dimension.height);
|
|
530
|
+
if (!newRC) {
|
|
531
|
+
this._setLastKnownColsAndRows();
|
|
532
|
+
return null;
|
|
533
|
+
}
|
|
534
|
+
if (this._cols !== newRC.cols || this._rows !== newRC.rows) {
|
|
535
|
+
this._cols = newRC.cols;
|
|
536
|
+
this._rows = newRC.rows;
|
|
537
|
+
this._fireMaximumDimensionsChanged();
|
|
538
|
+
}
|
|
539
|
+
return dimension.width;
|
|
540
|
+
}
|
|
541
|
+
_setLastKnownColsAndRows() {
|
|
542
|
+
if (TerminalInstance_1._lastKnownGridDimensions) {
|
|
543
|
+
this._cols = TerminalInstance_1._lastKnownGridDimensions.cols;
|
|
544
|
+
this._rows = TerminalInstance_1._lastKnownGridDimensions.rows;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
_fireMaximumDimensionsChanged() {
|
|
548
|
+
this._onMaximumDimensionsChanged.fire();
|
|
549
|
+
}
|
|
550
|
+
_getDimension(width, height) {
|
|
551
|
+
const font = this.xterm ? this.xterm.getFont() : this._terminalConfigurationService.getFont(getWindow(this.domElement));
|
|
552
|
+
if (!font || !font.charWidth || !font.charHeight) {
|
|
553
|
+
return undefined;
|
|
554
|
+
}
|
|
555
|
+
if (!this.xterm?.raw.element) {
|
|
556
|
+
return undefined;
|
|
557
|
+
}
|
|
558
|
+
const computedStyle = getWindow(this.xterm.raw.element).getComputedStyle(this.xterm.raw.element);
|
|
559
|
+
const horizontalPadding = parseInt(computedStyle.paddingLeft) + parseInt(computedStyle.paddingRight) + 14 ;
|
|
560
|
+
const verticalPadding = parseInt(computedStyle.paddingTop) + parseInt(computedStyle.paddingBottom);
|
|
561
|
+
TerminalInstance_1._lastKnownCanvasDimensions = new Dimension(Math.min(4096 , width - horizontalPadding), height - verticalPadding + (this._hasScrollBar && this._horizontalScrollbar ? -5 : 0));
|
|
562
|
+
return TerminalInstance_1._lastKnownCanvasDimensions;
|
|
563
|
+
}
|
|
564
|
+
get persistentProcessId() { return this._processManager.persistentProcessId; }
|
|
565
|
+
get shouldPersist() { return this._processManager.shouldPersist && !this.shellLaunchConfig.isTransient && (!this.reconnectionProperties || this._configurationService.getValue('task.reconnection') === true); }
|
|
566
|
+
static getXtermConstructor(keybindingService, contextKeyService) {
|
|
567
|
+
const keybinding = keybindingService.lookupKeybinding("workbench.action.terminal.focusAccessibleBuffer" , contextKeyService);
|
|
568
|
+
if (xtermConstructor) {
|
|
569
|
+
return xtermConstructor;
|
|
570
|
+
}
|
|
571
|
+
xtermConstructor = Promises.withAsyncBody(async (resolve) => {
|
|
572
|
+
const Terminal = (await import('@xterm/xterm').then(module => module.default ?? module)).Terminal;
|
|
573
|
+
Terminal.strings.promptLabel = ( localize(9051, 'Terminal input'));
|
|
574
|
+
Terminal.strings.tooMuchOutput = keybinding ? ( localize(
|
|
575
|
+
9052,
|
|
576
|
+
'Use the accessible buffer {0} to manually review output',
|
|
577
|
+
keybinding.getLabel()
|
|
578
|
+
)) : ( localize(
|
|
579
|
+
9053,
|
|
580
|
+
'Use the Terminal: Focus Accessible Buffer command to manually review output'
|
|
581
|
+
));
|
|
582
|
+
resolve(Terminal);
|
|
583
|
+
});
|
|
584
|
+
return xtermConstructor;
|
|
585
|
+
}
|
|
586
|
+
async _createXterm() {
|
|
587
|
+
const Terminal = await TerminalInstance_1.getXtermConstructor(this._keybindingService, this._contextKeyService);
|
|
588
|
+
if (this.isDisposed) {
|
|
589
|
+
throw ( (new ErrorNoTelemetry('Terminal disposed of during xterm.js creation')));
|
|
590
|
+
}
|
|
591
|
+
const disableShellIntegrationReporting = (this.shellLaunchConfig.executable === undefined || this.shellType === undefined) || !shellIntegrationSupportedShellTypes.includes(this.shellType);
|
|
592
|
+
const xterm = this._scopedInstantiationService.createInstance(XtermTerminal, Terminal, this._cols, this._rows, this._scopedInstantiationService.createInstance(TerminalInstanceColorProvider, this), this.capabilities, this._processManager.shellIntegrationNonce, disableShellIntegrationReporting);
|
|
593
|
+
this.xterm = xterm;
|
|
594
|
+
this._resizeDebouncer = this._register(( (new TerminalResizeDebouncer(() => this._isVisible, () => xterm, async (cols, rows) => {
|
|
595
|
+
xterm.raw.resize(cols, rows);
|
|
596
|
+
await this._updatePtyDimensions(xterm.raw);
|
|
597
|
+
}, async (cols) => {
|
|
598
|
+
xterm.raw.resize(cols, xterm.raw.rows);
|
|
599
|
+
await this._updatePtyDimensions(xterm.raw);
|
|
600
|
+
}, async (rows) => {
|
|
601
|
+
xterm.raw.resize(xterm.raw.cols, rows);
|
|
602
|
+
await this._updatePtyDimensions(xterm.raw);
|
|
603
|
+
}))));
|
|
604
|
+
this.updateAccessibilitySupport();
|
|
605
|
+
this._register(this.xterm.onDidRequestRunCommand(e => {
|
|
606
|
+
if (e.copyAsHtml) {
|
|
607
|
+
this.copySelection(true, e.command);
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
this.sendText(e.command.command, e.noNewLine ? false : true);
|
|
611
|
+
}
|
|
612
|
+
}));
|
|
613
|
+
this._register(this.xterm.onDidRequestRefreshDimensions(() => {
|
|
614
|
+
if (this._lastLayoutDimensions) {
|
|
615
|
+
this.layout(this._lastLayoutDimensions);
|
|
616
|
+
}
|
|
617
|
+
}));
|
|
618
|
+
const initialTextWrittenPromise = this._shellLaunchConfig.initialText ? ( (new Promise(r => this._writeInitialText(xterm, r)))) : undefined;
|
|
619
|
+
const lineDataEventAddon = this._register(( (new LineDataEventAddon(initialTextWrittenPromise))));
|
|
620
|
+
this._register(lineDataEventAddon.onLineData(e => this._onLineData.fire(e)));
|
|
621
|
+
this._lineDataEventAddon = lineDataEventAddon;
|
|
622
|
+
disposableTimeout(() => {
|
|
623
|
+
this._register(xterm.raw.onBell(() => {
|
|
624
|
+
if (this._configurationService.getValue("terminal.integrated.enableBell" ) || this._configurationService.getValue("terminal.integrated.enableVisualBell" )) {
|
|
625
|
+
this.statusList.add({
|
|
626
|
+
id: "bell" ,
|
|
627
|
+
severity: Severity$1.Warning,
|
|
628
|
+
icon: Codicon.bell,
|
|
629
|
+
tooltip: ( localize(9054, "Bell"))
|
|
630
|
+
}, this._terminalConfigurationService.config.bellDuration);
|
|
631
|
+
}
|
|
632
|
+
this._accessibilitySignalService.playSignal(AccessibilitySignal.terminalBell);
|
|
633
|
+
}));
|
|
634
|
+
}, 1000, this._store);
|
|
635
|
+
this._register(xterm.raw.onSelectionChange(async () => this._onSelectionChange()));
|
|
636
|
+
this._register(xterm.raw.buffer.onBufferChange(() => this._refreshAltBufferContextKey()));
|
|
637
|
+
this._register(this._processManager.onProcessData(e => this._onProcessData(e)));
|
|
638
|
+
this._register(xterm.raw.onData(async (data) => {
|
|
639
|
+
await this._pauseInputEventBarrier?.wait();
|
|
640
|
+
await this._processManager.write(data);
|
|
641
|
+
this._onDidInputData.fire(data);
|
|
642
|
+
}));
|
|
643
|
+
this._register(xterm.raw.onBinary(data => this._processManager.processBinary(data)));
|
|
644
|
+
this._register(this._processManager.onProcessReady(async (processTraits) => {
|
|
645
|
+
if (this._processManager.os) {
|
|
646
|
+
lineDataEventAddon.setOperatingSystem(this._processManager.os);
|
|
647
|
+
}
|
|
648
|
+
xterm.raw.options.windowsPty = processTraits.windowsPty;
|
|
649
|
+
}));
|
|
650
|
+
this._register(this._processManager.onRestoreCommands(e => this.xterm?.shellIntegration.deserialize(e)));
|
|
651
|
+
this._register(this._viewDescriptorService.onDidChangeLocation(({ views }) => {
|
|
652
|
+
if (( (views.some(v => v.id === TERMINAL_VIEW_ID)))) {
|
|
653
|
+
xterm.refresh();
|
|
654
|
+
}
|
|
655
|
+
}));
|
|
656
|
+
if (!( (this.capabilities.has(0 )))) {
|
|
657
|
+
let onKeyListener = xterm.raw.onKey(e => {
|
|
658
|
+
const event = ( (new StandardKeyboardEvent(e.domEvent)));
|
|
659
|
+
if (event.equals(3 )) {
|
|
660
|
+
this._updateProcessCwd();
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
this._register(this.capabilities.onDidAddCapabilityType(e => {
|
|
664
|
+
if (e === 0 ) {
|
|
665
|
+
onKeyListener?.dispose();
|
|
666
|
+
onKeyListener = undefined;
|
|
667
|
+
}
|
|
668
|
+
}));
|
|
669
|
+
}
|
|
670
|
+
this._pathService.userHome().then(userHome => {
|
|
671
|
+
this._userHome = userHome.fsPath;
|
|
672
|
+
});
|
|
673
|
+
if (this._isVisible) {
|
|
674
|
+
this._open();
|
|
675
|
+
}
|
|
676
|
+
return xterm;
|
|
677
|
+
}
|
|
678
|
+
async _onLineDataSetup() {
|
|
679
|
+
const xterm = this.xterm || (await this._xtermReadyPromise);
|
|
680
|
+
xterm.raw.loadAddon(this._lineDataEventAddon);
|
|
681
|
+
}
|
|
682
|
+
async runCommand(commandLine, shouldExecute) {
|
|
683
|
+
let commandDetection = this.capabilities.get(2 );
|
|
684
|
+
if (!commandDetection && ((this._processManager.processState === 1 || this._processManager.processState === 2) )) {
|
|
685
|
+
const store = ( (new DisposableStore()));
|
|
686
|
+
await Promise.race([
|
|
687
|
+
( (new Promise(r => {
|
|
688
|
+
store.add(this.capabilities.onDidAddCapabilityType(e => {
|
|
689
|
+
if (e === 2 ) {
|
|
690
|
+
commandDetection = this.capabilities.get(2 );
|
|
691
|
+
r();
|
|
692
|
+
}
|
|
693
|
+
}));
|
|
694
|
+
}))),
|
|
695
|
+
timeout(2000),
|
|
696
|
+
]);
|
|
697
|
+
store.dispose();
|
|
698
|
+
}
|
|
699
|
+
if (!commandDetection || commandDetection.promptInputModel.value.length > 0) {
|
|
700
|
+
await this.sendText('\x03', false);
|
|
701
|
+
await timeout(100);
|
|
702
|
+
}
|
|
703
|
+
await this.sendText(commandLine, shouldExecute, !shouldExecute);
|
|
704
|
+
}
|
|
705
|
+
async runRecent(type, filterMode, value) {
|
|
706
|
+
return this._scopedInstantiationService.invokeFunction(showRunRecentQuickPick, this, this._terminalInRunCommandPicker, type, filterMode, value);
|
|
707
|
+
}
|
|
708
|
+
detachFromElement() {
|
|
709
|
+
this._wrapperElement.remove();
|
|
710
|
+
this._container = undefined;
|
|
711
|
+
}
|
|
712
|
+
attachToElement(container) {
|
|
713
|
+
if (this._container === container) {
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
if (!this._attachBarrier.isOpen()) {
|
|
717
|
+
this._attachBarrier.open();
|
|
718
|
+
}
|
|
719
|
+
this._container = container;
|
|
720
|
+
this._container.appendChild(this._wrapperElement);
|
|
721
|
+
if (this.xterm?.raw.element) {
|
|
722
|
+
this.xterm.raw.open(this.xterm.raw.element);
|
|
723
|
+
}
|
|
724
|
+
this.xterm?.refresh();
|
|
725
|
+
setTimeout(() => this._initDragAndDrop(container));
|
|
726
|
+
}
|
|
727
|
+
_open() {
|
|
728
|
+
if (!this.xterm || this.xterm.raw.element) {
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
if (!this._container || !this._container.isConnected) {
|
|
732
|
+
throw ( (new Error(
|
|
733
|
+
'A container element needs to be set with `attachToElement` and be part of the DOM before calling `_open`'
|
|
734
|
+
)));
|
|
735
|
+
}
|
|
736
|
+
const xtermElement = document.createElement('div');
|
|
737
|
+
this._wrapperElement.appendChild(xtermElement);
|
|
738
|
+
this._container.appendChild(this._wrapperElement);
|
|
739
|
+
const xterm = this.xterm;
|
|
740
|
+
this._wrapperElement.xterm = xterm.raw;
|
|
741
|
+
const screenElement = xterm.attachToElement(xtermElement);
|
|
742
|
+
for (const contribution of ( (this._contributions.values()))) {
|
|
743
|
+
if (!this.xterm) {
|
|
744
|
+
this._xtermReadyPromise.then(xterm => contribution.xtermOpen?.(xterm));
|
|
745
|
+
}
|
|
746
|
+
else {
|
|
747
|
+
contribution.xtermOpen?.(this.xterm);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
this._register(xterm.shellIntegration.onDidChangeStatus(() => {
|
|
751
|
+
if (this.hasFocus) {
|
|
752
|
+
this._setShellIntegrationContextKey();
|
|
753
|
+
}
|
|
754
|
+
else {
|
|
755
|
+
this._terminalShellIntegrationEnabledContextKey.reset();
|
|
756
|
+
}
|
|
757
|
+
}));
|
|
758
|
+
if (!xterm.raw.element || !xterm.raw.textarea) {
|
|
759
|
+
throw ( (new Error('xterm elements not set after open')));
|
|
760
|
+
}
|
|
761
|
+
this._setAriaLabel(xterm.raw, this._instanceId, this._title);
|
|
762
|
+
xterm.raw.attachCustomKeyEventHandler((event) => {
|
|
763
|
+
if (this._isExiting) {
|
|
764
|
+
return false;
|
|
765
|
+
}
|
|
766
|
+
const standardKeyboardEvent = ( (new StandardKeyboardEvent(event)));
|
|
767
|
+
const resolveResult = this._keybindingService.softDispatch(standardKeyboardEvent, standardKeyboardEvent.target);
|
|
768
|
+
const isValidChord = resolveResult.kind === 1 && this._terminalConfigurationService.config.allowChords && event.key !== 'Escape';
|
|
769
|
+
if (this._keybindingService.inChordMode || isValidChord) {
|
|
770
|
+
event.preventDefault();
|
|
771
|
+
return false;
|
|
772
|
+
}
|
|
773
|
+
const SHOW_TERMINAL_CONFIG_PROMPT_KEY = 'terminal.integrated.showTerminalConfigPrompt';
|
|
774
|
+
const EXCLUDED_KEYS = ['RightArrow', 'LeftArrow', 'UpArrow', 'DownArrow', 'Space', 'Meta', 'Control', 'Shift', 'Alt', '', 'Delete', 'Backspace', 'Tab'];
|
|
775
|
+
if (this._storageService.getBoolean(SHOW_TERMINAL_CONFIG_PROMPT_KEY, -1 , true) &&
|
|
776
|
+
!EXCLUDED_KEYS.includes(event.key) &&
|
|
777
|
+
!event.ctrlKey &&
|
|
778
|
+
!event.shiftKey &&
|
|
779
|
+
!event.altKey) {
|
|
780
|
+
this._hasHadInput = true;
|
|
781
|
+
}
|
|
782
|
+
if (resolveResult.kind === 2 && resolveResult.commandId && ( (this._skipTerminalCommands.some(k => k === resolveResult.commandId))) && !this._terminalConfigurationService.config.sendKeybindingsToShell) {
|
|
783
|
+
if (this._storageService.getBoolean(SHOW_TERMINAL_CONFIG_PROMPT_KEY, -1 , true) &&
|
|
784
|
+
this._hasHadInput &&
|
|
785
|
+
!TERMINAL_CREATION_COMMANDS.includes(resolveResult.commandId)) {
|
|
786
|
+
this._notificationService.prompt(Severity$1.Info, ( localize(
|
|
787
|
+
9055,
|
|
788
|
+
"Some keybindings don't go to the terminal by default and are handled by {0} instead.",
|
|
789
|
+
this._productService.nameLong
|
|
790
|
+
)), [
|
|
791
|
+
{
|
|
792
|
+
label: ( localize(9056, "Configure Terminal Settings")),
|
|
793
|
+
run: () => {
|
|
794
|
+
this._preferencesService.openSettings({ jsonEditor: false, query: `@id:${"terminal.integrated.commandsToSkipShell" },${"terminal.integrated.sendKeybindingsToShell" },${"terminal.integrated.allowChords" }` });
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
]);
|
|
798
|
+
this._storageService.store(SHOW_TERMINAL_CONFIG_PROMPT_KEY, false, -1 , 0 );
|
|
799
|
+
}
|
|
800
|
+
event.preventDefault();
|
|
801
|
+
return false;
|
|
802
|
+
}
|
|
803
|
+
if (this._terminalConfigurationService.config.allowMnemonics && !isMacintosh && event.altKey) {
|
|
804
|
+
return false;
|
|
805
|
+
}
|
|
806
|
+
if (TabFocus.getTabFocusMode() && event.key === 'Tab') {
|
|
807
|
+
return false;
|
|
808
|
+
}
|
|
809
|
+
if (event.key === 'Tab' && event.shiftKey) {
|
|
810
|
+
event.preventDefault();
|
|
811
|
+
return true;
|
|
812
|
+
}
|
|
813
|
+
if (isWindows && event.altKey && event.key === 'F4' && !event.ctrlKey) {
|
|
814
|
+
return false;
|
|
815
|
+
}
|
|
816
|
+
if (!BrowserFeatures.clipboard.readText && event.key === 'v' && event.ctrlKey) {
|
|
817
|
+
return false;
|
|
818
|
+
}
|
|
819
|
+
return true;
|
|
820
|
+
});
|
|
821
|
+
this._register(addDisposableListener(xterm.raw.element, 'mousedown', () => {
|
|
822
|
+
const listener = addDisposableListener(xterm.raw.element.ownerDocument, 'mouseup', () => {
|
|
823
|
+
setTimeout(() => this._refreshSelectionContextKey(), 0);
|
|
824
|
+
listener.dispose();
|
|
825
|
+
});
|
|
826
|
+
}));
|
|
827
|
+
this._register(addDisposableListener(xterm.raw.element, 'touchstart', () => {
|
|
828
|
+
xterm.raw.focus();
|
|
829
|
+
}));
|
|
830
|
+
this._register(addDisposableListener(xterm.raw.element, 'keyup', () => {
|
|
831
|
+
setTimeout(() => this._refreshSelectionContextKey(), 0);
|
|
832
|
+
}));
|
|
833
|
+
this._register(addDisposableListener(xterm.raw.textarea, 'focus', () => this._setFocus(true)));
|
|
834
|
+
this._register(addDisposableListener(xterm.raw.textarea, 'blur', () => this._setFocus(false)));
|
|
835
|
+
this._register(addDisposableListener(xterm.raw.textarea, 'focusout', () => this._setFocus(false)));
|
|
836
|
+
this._initDragAndDrop(this._container);
|
|
837
|
+
this._widgetManager.attachToElement(screenElement);
|
|
838
|
+
if (this._lastLayoutDimensions) {
|
|
839
|
+
this.layout(this._lastLayoutDimensions);
|
|
840
|
+
}
|
|
841
|
+
this.updateConfig();
|
|
842
|
+
if (xterm.raw.options.disableStdin) {
|
|
843
|
+
this._attachPressAnyKeyToCloseListener(xterm.raw);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
_setFocus(focused) {
|
|
847
|
+
if (focused) {
|
|
848
|
+
this._terminalFocusContextKey.set(true);
|
|
849
|
+
this._setShellIntegrationContextKey();
|
|
850
|
+
this._onDidFocus.fire(this);
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
this.resetFocusContextKey();
|
|
854
|
+
this._onDidBlur.fire(this);
|
|
855
|
+
this._refreshSelectionContextKey();
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
_setShellIntegrationContextKey() {
|
|
859
|
+
if (this.xterm) {
|
|
860
|
+
this._terminalShellIntegrationEnabledContextKey.set(this.xterm.shellIntegration.status === 2 );
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
resetFocusContextKey() {
|
|
864
|
+
this._terminalFocusContextKey.reset();
|
|
865
|
+
this._terminalShellIntegrationEnabledContextKey.reset();
|
|
866
|
+
}
|
|
867
|
+
_initDragAndDrop(container) {
|
|
868
|
+
const store = ( (new DisposableStore()));
|
|
869
|
+
const dndController = store.add(this._scopedInstantiationService.createInstance(TerminalInstanceDragAndDropController, container));
|
|
870
|
+
store.add(dndController.onDropTerminal(e => this._onRequestAddInstanceToGroup.fire(e)));
|
|
871
|
+
store.add(dndController.onDropFile(async (path) => {
|
|
872
|
+
this.focus();
|
|
873
|
+
await this.sendPath(path, false);
|
|
874
|
+
}));
|
|
875
|
+
store.add(new DragAndDropObserver(container, dndController));
|
|
876
|
+
this._dndObserver.value = store;
|
|
877
|
+
}
|
|
878
|
+
hasSelection() {
|
|
879
|
+
return this.xterm ? this.xterm.raw.hasSelection() : false;
|
|
880
|
+
}
|
|
881
|
+
async copySelection(asHtml, command) {
|
|
882
|
+
const xterm = await this._xtermReadyPromise;
|
|
883
|
+
await xterm.copySelection(asHtml, command);
|
|
884
|
+
}
|
|
885
|
+
get selection() {
|
|
886
|
+
return this.xterm && this.hasSelection() ? this.xterm.raw.getSelection() : undefined;
|
|
887
|
+
}
|
|
888
|
+
clearSelection() {
|
|
889
|
+
this.xterm?.raw.clearSelection();
|
|
890
|
+
}
|
|
891
|
+
_refreshAltBufferContextKey() {
|
|
892
|
+
this._terminalAltBufferActiveContextKey.set(!!(this.xterm && this.xterm.raw.buffer.active === this.xterm.raw.buffer.alternate));
|
|
893
|
+
}
|
|
894
|
+
dispose(reason) {
|
|
895
|
+
if (this.shellLaunchConfig.type === 'Task' && reason === TerminalExitReason.Process && this._exitCode !== 0 && !this.shellLaunchConfig.waitOnExit) {
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
if (this.isDisposed) {
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
this._logService.trace(`terminalInstance#dispose (instanceId: ${this.instanceId})`);
|
|
902
|
+
dispose(this._widgetManager);
|
|
903
|
+
if (this.xterm?.raw.element) {
|
|
904
|
+
this._hadFocusOnExit = this.hasFocus;
|
|
905
|
+
}
|
|
906
|
+
if (this._wrapperElement.xterm) {
|
|
907
|
+
this._wrapperElement.xterm = undefined;
|
|
908
|
+
}
|
|
909
|
+
if (this._horizontalScrollbar) {
|
|
910
|
+
this._horizontalScrollbar.dispose();
|
|
911
|
+
this._horizontalScrollbar = undefined;
|
|
912
|
+
}
|
|
913
|
+
try {
|
|
914
|
+
this.xterm?.dispose();
|
|
915
|
+
}
|
|
916
|
+
catch (err) {
|
|
917
|
+
this._logService.error('Exception occurred during xterm disposal', err);
|
|
918
|
+
}
|
|
919
|
+
if (isFirefox) {
|
|
920
|
+
this.resetFocusContextKey();
|
|
921
|
+
this._terminalHasTextContextKey.reset();
|
|
922
|
+
this._onDidBlur.fire(this);
|
|
923
|
+
}
|
|
924
|
+
if (this._pressAnyKeyToCloseListener) {
|
|
925
|
+
this._pressAnyKeyToCloseListener.dispose();
|
|
926
|
+
this._pressAnyKeyToCloseListener = undefined;
|
|
927
|
+
}
|
|
928
|
+
if (this._exitReason === undefined) {
|
|
929
|
+
this._exitReason = reason ?? TerminalExitReason.Unknown;
|
|
930
|
+
}
|
|
931
|
+
this._processManager.dispose();
|
|
932
|
+
this._onProcessExit(undefined);
|
|
933
|
+
this._onDisposed.fire(this);
|
|
934
|
+
super.dispose();
|
|
935
|
+
}
|
|
936
|
+
async detachProcessAndDispose(reason) {
|
|
937
|
+
await this._processManager.detachFromProcess(reason === TerminalExitReason.User);
|
|
938
|
+
this.dispose(reason);
|
|
939
|
+
}
|
|
940
|
+
focus(force) {
|
|
941
|
+
this._refreshAltBufferContextKey();
|
|
942
|
+
if (!this.xterm) {
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
if (force || !getActiveWindow().getSelection()?.toString()) {
|
|
946
|
+
this.xterm.raw.focus();
|
|
947
|
+
this._onDidRequestFocus.fire();
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
async focusWhenReady(force) {
|
|
951
|
+
await this._xtermReadyPromise;
|
|
952
|
+
await this._attachBarrier.wait();
|
|
953
|
+
this.focus(force);
|
|
954
|
+
}
|
|
955
|
+
async paste() {
|
|
956
|
+
await this._paste(await this._clipboardService.readText());
|
|
957
|
+
}
|
|
958
|
+
async pasteSelection() {
|
|
959
|
+
await this._paste(await this._clipboardService.readText('selection'));
|
|
960
|
+
}
|
|
961
|
+
async _paste(value) {
|
|
962
|
+
if (!this.xterm) {
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
let currentText = value;
|
|
966
|
+
const shouldPasteText = await this._scopedInstantiationService.invokeFunction(shouldPasteTerminalText, currentText, this.xterm?.raw.modes.bracketedPasteMode);
|
|
967
|
+
if (!shouldPasteText) {
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
if (typeof shouldPasteText === 'object') {
|
|
971
|
+
currentText = shouldPasteText.modifiedText;
|
|
972
|
+
}
|
|
973
|
+
this.focus();
|
|
974
|
+
this._onWillPaste.fire(currentText);
|
|
975
|
+
this.xterm.raw.paste(currentText);
|
|
976
|
+
this._onDidPaste.fire(currentText);
|
|
977
|
+
}
|
|
978
|
+
async sendText(text, shouldExecute, bracketedPasteMode) {
|
|
979
|
+
if (bracketedPasteMode && this.xterm?.raw.modes.bracketedPasteMode) {
|
|
980
|
+
text = `\x1b[200~${text}\x1b[201~`;
|
|
981
|
+
}
|
|
982
|
+
text = text.replace(/\r?\n/g, '\r');
|
|
983
|
+
if (shouldExecute && !text.endsWith('\r')) {
|
|
984
|
+
text += '\r';
|
|
985
|
+
}
|
|
986
|
+
this._logService.debug('sending data (vscode)', text);
|
|
987
|
+
await this._processManager.write(text);
|
|
988
|
+
this._onDidInputData.fire(text);
|
|
989
|
+
this._onDidSendText.fire(text);
|
|
990
|
+
this.xterm?.scrollToBottom();
|
|
991
|
+
if (shouldExecute) {
|
|
992
|
+
this._onDidExecuteText.fire();
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
async sendPath(originalPath, shouldExecute) {
|
|
996
|
+
return this.sendText(await this.preparePathForShell(originalPath), shouldExecute);
|
|
997
|
+
}
|
|
998
|
+
async preparePathForShell(originalPath) {
|
|
999
|
+
await this.processReady;
|
|
1000
|
+
return preparePathForShell(originalPath, this.shellLaunchConfig.executable, this.title, this.shellType, this._processManager.backend, this._processManager.os);
|
|
1001
|
+
}
|
|
1002
|
+
setVisible(visible) {
|
|
1003
|
+
const didChange = this._isVisible !== visible;
|
|
1004
|
+
this._isVisible = visible;
|
|
1005
|
+
this._wrapperElement.classList.toggle('active', visible);
|
|
1006
|
+
if (visible && this.xterm) {
|
|
1007
|
+
this._open();
|
|
1008
|
+
this._resizeDebouncer?.flush();
|
|
1009
|
+
this._resize();
|
|
1010
|
+
}
|
|
1011
|
+
if (didChange) {
|
|
1012
|
+
this._onDidChangeVisibility.fire(visible);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
scrollDownLine() {
|
|
1016
|
+
this.xterm?.scrollDownLine();
|
|
1017
|
+
}
|
|
1018
|
+
scrollDownPage() {
|
|
1019
|
+
this.xterm?.scrollDownPage();
|
|
1020
|
+
}
|
|
1021
|
+
scrollToBottom() {
|
|
1022
|
+
this.xterm?.scrollToBottom();
|
|
1023
|
+
}
|
|
1024
|
+
scrollUpLine() {
|
|
1025
|
+
this.xterm?.scrollUpLine();
|
|
1026
|
+
}
|
|
1027
|
+
scrollUpPage() {
|
|
1028
|
+
this.xterm?.scrollUpPage();
|
|
1029
|
+
}
|
|
1030
|
+
scrollToTop() {
|
|
1031
|
+
this.xterm?.scrollToTop();
|
|
1032
|
+
}
|
|
1033
|
+
clearBuffer() {
|
|
1034
|
+
this._processManager.clearBuffer();
|
|
1035
|
+
this.xterm?.clearBuffer();
|
|
1036
|
+
}
|
|
1037
|
+
_refreshSelectionContextKey() {
|
|
1038
|
+
const isActive = !!this._viewsService.getActiveViewWithId(TERMINAL_VIEW_ID);
|
|
1039
|
+
let isEditorActive = false;
|
|
1040
|
+
const editor = this._editorService.activeEditor;
|
|
1041
|
+
if (editor) {
|
|
1042
|
+
isEditorActive = editor instanceof TerminalEditorInput;
|
|
1043
|
+
}
|
|
1044
|
+
this._terminalHasTextContextKey.set((isActive || isEditorActive) && this.hasSelection());
|
|
1045
|
+
}
|
|
1046
|
+
_createProcessManager() {
|
|
1047
|
+
let deserializedCollections;
|
|
1048
|
+
if (this.shellLaunchConfig.attachPersistentProcess?.environmentVariableCollections) {
|
|
1049
|
+
deserializedCollections = deserializeEnvironmentVariableCollections(this.shellLaunchConfig.attachPersistentProcess.environmentVariableCollections);
|
|
1050
|
+
}
|
|
1051
|
+
const processManager = this._scopedInstantiationService.createInstance(TerminalProcessManager, this._instanceId, this.shellLaunchConfig?.cwd, deserializedCollections, this.shellLaunchConfig.attachPersistentProcess?.shellIntegrationNonce);
|
|
1052
|
+
this.capabilities.add(processManager.capabilities);
|
|
1053
|
+
this._register(processManager.onProcessReady(async (e) => {
|
|
1054
|
+
this._onProcessIdReady.fire(this);
|
|
1055
|
+
this._initialCwd = await this.getInitialCwd();
|
|
1056
|
+
if (!this._labelComputer) {
|
|
1057
|
+
this._labelComputer = this._register(this._scopedInstantiationService.createInstance(TerminalLabelComputer));
|
|
1058
|
+
this._register(this._labelComputer.onDidChangeLabel(e => {
|
|
1059
|
+
const wasChanged = this._title !== e.title || this._description !== e.description;
|
|
1060
|
+
if (wasChanged) {
|
|
1061
|
+
this._title = e.title;
|
|
1062
|
+
this._description = e.description;
|
|
1063
|
+
this._onTitleChanged.fire(this);
|
|
1064
|
+
}
|
|
1065
|
+
}));
|
|
1066
|
+
}
|
|
1067
|
+
if (this._shellLaunchConfig.name) {
|
|
1068
|
+
this._setTitle(this._shellLaunchConfig.name, TitleEventSource.Api);
|
|
1069
|
+
}
|
|
1070
|
+
else {
|
|
1071
|
+
setTimeout(() => {
|
|
1072
|
+
this._xtermReadyPromise.then(xterm => {
|
|
1073
|
+
this._messageTitleDisposable.value = xterm.raw.onTitleChange(e => this._onTitleChange(e));
|
|
1074
|
+
});
|
|
1075
|
+
});
|
|
1076
|
+
this._setTitle(this._shellLaunchConfig.executable, TitleEventSource.Process);
|
|
1077
|
+
}
|
|
1078
|
+
}));
|
|
1079
|
+
this._register(processManager.onProcessExit(exitCode => this._onProcessExit(exitCode)));
|
|
1080
|
+
this._register(processManager.onDidChangeProperty(({ type, value }) => {
|
|
1081
|
+
switch (type) {
|
|
1082
|
+
case "cwd" :
|
|
1083
|
+
this._cwd = value;
|
|
1084
|
+
this._labelComputer?.refreshLabel(this);
|
|
1085
|
+
break;
|
|
1086
|
+
case "initialCwd" :
|
|
1087
|
+
this._initialCwd = value;
|
|
1088
|
+
this._cwd = this._initialCwd;
|
|
1089
|
+
this._setTitle(this.title, TitleEventSource.Config);
|
|
1090
|
+
this._icon = this._shellLaunchConfig.attachPersistentProcess?.icon || this._shellLaunchConfig.icon;
|
|
1091
|
+
this._onIconChanged.fire({ instance: this, userInitiated: false });
|
|
1092
|
+
break;
|
|
1093
|
+
case "title" :
|
|
1094
|
+
this._setTitle(value ?? '', TitleEventSource.Process);
|
|
1095
|
+
break;
|
|
1096
|
+
case "overrideDimensions" :
|
|
1097
|
+
this.setOverrideDimensions(value, true);
|
|
1098
|
+
break;
|
|
1099
|
+
case "resolvedShellLaunchConfig" :
|
|
1100
|
+
this._setResolvedShellLaunchConfig(value);
|
|
1101
|
+
break;
|
|
1102
|
+
case "shellType" :
|
|
1103
|
+
this.setShellType(value);
|
|
1104
|
+
break;
|
|
1105
|
+
case "hasChildProcesses" :
|
|
1106
|
+
this._onDidChangeHasChildProcesses.fire(value);
|
|
1107
|
+
break;
|
|
1108
|
+
case "usedShellIntegrationInjection" :
|
|
1109
|
+
this._usedShellIntegrationInjection = true;
|
|
1110
|
+
break;
|
|
1111
|
+
}
|
|
1112
|
+
}));
|
|
1113
|
+
this._initialDataEventsListener.value = processManager.onProcessData(ev => this._initialDataEvents?.push(ev.data));
|
|
1114
|
+
this._register(processManager.onProcessReplayComplete(() => this._onProcessReplayComplete.fire()));
|
|
1115
|
+
this._register(processManager.onEnvironmentVariableInfoChanged(e => this._onEnvironmentVariableInfoChanged(e)));
|
|
1116
|
+
this._register(processManager.onPtyDisconnect(() => {
|
|
1117
|
+
if (this.xterm) {
|
|
1118
|
+
this.xterm.raw.options.disableStdin = true;
|
|
1119
|
+
}
|
|
1120
|
+
this.statusList.add({
|
|
1121
|
+
id: "disconnected" ,
|
|
1122
|
+
severity: Severity$1.Error,
|
|
1123
|
+
icon: Codicon.debugDisconnect,
|
|
1124
|
+
tooltip: ( localize(9057, "Lost connection to process"))
|
|
1125
|
+
});
|
|
1126
|
+
}));
|
|
1127
|
+
this._register(processManager.onPtyReconnect(() => {
|
|
1128
|
+
if (this.xterm) {
|
|
1129
|
+
this.xterm.raw.options.disableStdin = false;
|
|
1130
|
+
}
|
|
1131
|
+
this.statusList.remove("disconnected" );
|
|
1132
|
+
}));
|
|
1133
|
+
return processManager;
|
|
1134
|
+
}
|
|
1135
|
+
async _createProcess() {
|
|
1136
|
+
if (this.isDisposed) {
|
|
1137
|
+
return;
|
|
1138
|
+
}
|
|
1139
|
+
const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(Schemas.file);
|
|
1140
|
+
if (activeWorkspaceRootUri) {
|
|
1141
|
+
const trusted = await this._trust();
|
|
1142
|
+
if (!trusted) {
|
|
1143
|
+
this._onProcessExit({ message: ( localize(9058, "Cannot launch a terminal process in an untrusted workspace")) });
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
else if (this._cwd && this._userHome && this._cwd !== this._userHome) {
|
|
1147
|
+
this._onProcessExit({
|
|
1148
|
+
message: ( localize(
|
|
1149
|
+
9059,
|
|
1150
|
+
"Cannot launch a terminal process in an untrusted workspace with cwd {0} and userHome {1}",
|
|
1151
|
+
this._cwd,
|
|
1152
|
+
this._userHome
|
|
1153
|
+
))
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
if (this._container && this._cols === 0 && this._rows === 0) {
|
|
1157
|
+
this._initDimensions();
|
|
1158
|
+
this.xterm?.raw.resize(this._cols || 80 , this._rows || 30 );
|
|
1159
|
+
}
|
|
1160
|
+
const originalIcon = this.shellLaunchConfig.icon;
|
|
1161
|
+
await this._processManager.createProcess(this._shellLaunchConfig, this._cols || 80 , this._rows || 30 ).then(result => {
|
|
1162
|
+
if (result) {
|
|
1163
|
+
if ('message' in result) {
|
|
1164
|
+
this._onProcessExit(result);
|
|
1165
|
+
}
|
|
1166
|
+
else if ('injectedArgs' in result) {
|
|
1167
|
+
this._injectedArgs = result.injectedArgs;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
1171
|
+
if (this.isDisposed) {
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
if (this.xterm?.shellIntegration) {
|
|
1175
|
+
this.capabilities.add(this.xterm.shellIntegration.capabilities);
|
|
1176
|
+
}
|
|
1177
|
+
if (originalIcon !== this.shellLaunchConfig.icon || this.shellLaunchConfig.color) {
|
|
1178
|
+
this._icon = this._shellLaunchConfig.attachPersistentProcess?.icon || this._shellLaunchConfig.icon;
|
|
1179
|
+
this._onIconChanged.fire({ instance: this, userInitiated: false });
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
registerMarker(offset) {
|
|
1183
|
+
return this.xterm?.raw.registerMarker(offset);
|
|
1184
|
+
}
|
|
1185
|
+
addBufferMarker(properties) {
|
|
1186
|
+
this.capabilities.get(4 )?.addMark(properties);
|
|
1187
|
+
}
|
|
1188
|
+
scrollToMark(startMarkId, endMarkId, highlight) {
|
|
1189
|
+
this.xterm?.markTracker.scrollToClosestMarker(startMarkId, endMarkId, highlight);
|
|
1190
|
+
}
|
|
1191
|
+
async freePortKillProcess(port, command) {
|
|
1192
|
+
await this._processManager?.freePortKillProcess(port);
|
|
1193
|
+
this.runCommand(command, false);
|
|
1194
|
+
}
|
|
1195
|
+
_onProcessData(ev) {
|
|
1196
|
+
const execIndex = ev.data.indexOf('\x1b]633;C\x07');
|
|
1197
|
+
if (execIndex !== -1) {
|
|
1198
|
+
if (ev.trackCommit) {
|
|
1199
|
+
this._writeProcessData(ev.data.substring(0, execIndex + '\x1b]633;C\x07'.length));
|
|
1200
|
+
ev.writePromise = ( (new Promise(
|
|
1201
|
+
r => this._writeProcessData(ev.data.substring(execIndex + '\x1b]633;C\x07'.length), r)
|
|
1202
|
+
)));
|
|
1203
|
+
}
|
|
1204
|
+
else {
|
|
1205
|
+
this._writeProcessData(ev.data.substring(0, execIndex + '\x1b]633;C\x07'.length));
|
|
1206
|
+
this._writeProcessData(ev.data.substring(execIndex + '\x1b]633;C\x07'.length));
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
else {
|
|
1210
|
+
if (ev.trackCommit) {
|
|
1211
|
+
ev.writePromise = ( (new Promise(r => this._writeProcessData(ev.data, r))));
|
|
1212
|
+
}
|
|
1213
|
+
else {
|
|
1214
|
+
this._writeProcessData(ev.data);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
_writeProcessData(data, cb) {
|
|
1219
|
+
this._onWillData.fire(data);
|
|
1220
|
+
const messageId = ++this._latestXtermWriteData;
|
|
1221
|
+
this.xterm?.raw.write(data, () => {
|
|
1222
|
+
this._latestXtermParseData = messageId;
|
|
1223
|
+
this._processManager.acknowledgeDataEvent(data.length);
|
|
1224
|
+
cb?.();
|
|
1225
|
+
this._onData.fire(data);
|
|
1226
|
+
});
|
|
1227
|
+
}
|
|
1228
|
+
async _onProcessExit(exitCodeOrError) {
|
|
1229
|
+
if (this._isExiting) {
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
const parsedExitResult = parseExitResult(exitCodeOrError, this.shellLaunchConfig, this._processManager.processState, this._initialCwd);
|
|
1233
|
+
if (this._usedShellIntegrationInjection && this._processManager.processState === 4 && parsedExitResult?.code !== 0) {
|
|
1234
|
+
this._relaunchWithShellIntegrationDisabled(parsedExitResult?.message);
|
|
1235
|
+
this._onExit.fire(exitCodeOrError);
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
this._isExiting = true;
|
|
1239
|
+
await this._flushXtermData();
|
|
1240
|
+
this._exitCode = parsedExitResult?.code;
|
|
1241
|
+
const exitMessage = parsedExitResult?.message;
|
|
1242
|
+
this._logService.debug('Terminal process exit', 'instanceId', this.instanceId, 'code', this._exitCode, 'processState', this._processManager.processState);
|
|
1243
|
+
const waitOnExit = this.waitOnExit;
|
|
1244
|
+
if (waitOnExit && this._processManager.processState !== 5 ) {
|
|
1245
|
+
this._xtermReadyPromise.then(xterm => {
|
|
1246
|
+
if (exitMessage) {
|
|
1247
|
+
xterm.raw.write(formatMessageForTerminal(exitMessage));
|
|
1248
|
+
}
|
|
1249
|
+
switch (typeof waitOnExit) {
|
|
1250
|
+
case 'string':
|
|
1251
|
+
xterm.raw.write(formatMessageForTerminal(waitOnExit, { excludeLeadingNewLine: true }));
|
|
1252
|
+
break;
|
|
1253
|
+
case 'function':
|
|
1254
|
+
if (this.exitCode !== undefined) {
|
|
1255
|
+
xterm.raw.write(formatMessageForTerminal(waitOnExit(this.exitCode), { excludeLeadingNewLine: true }));
|
|
1256
|
+
}
|
|
1257
|
+
break;
|
|
1258
|
+
}
|
|
1259
|
+
xterm.raw.options.disableStdin = true;
|
|
1260
|
+
if (xterm.raw.textarea) {
|
|
1261
|
+
this._attachPressAnyKeyToCloseListener(xterm.raw);
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
else {
|
|
1266
|
+
if (exitMessage) {
|
|
1267
|
+
const failedDuringLaunch = this._processManager.processState === 4 ;
|
|
1268
|
+
if (failedDuringLaunch || this._terminalConfigurationService.config.showExitAlert) {
|
|
1269
|
+
this._notificationService.notify({
|
|
1270
|
+
message: exitMessage,
|
|
1271
|
+
severity: Severity$1.Error,
|
|
1272
|
+
actions: { primary: [this._scopedInstantiationService.createInstance(TerminalLaunchHelpAction)] }
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
else {
|
|
1276
|
+
this._logService.warn(exitMessage);
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
this.dispose(TerminalExitReason.Process);
|
|
1280
|
+
}
|
|
1281
|
+
this._onExit.fire(exitCodeOrError);
|
|
1282
|
+
if (this.isDisposed) {
|
|
1283
|
+
this._onExit.dispose();
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
_relaunchWithShellIntegrationDisabled(exitMessage) {
|
|
1287
|
+
this._shellLaunchConfig.ignoreShellIntegration = true;
|
|
1288
|
+
this.relaunch();
|
|
1289
|
+
this.statusList.add({
|
|
1290
|
+
id: "shell-integration-attention-needed" ,
|
|
1291
|
+
severity: Severity$1.Warning,
|
|
1292
|
+
icon: Codicon.warning,
|
|
1293
|
+
tooltip: `${exitMessage} ` + ( localize(9060, 'Disabling shell integration in user settings might help.')),
|
|
1294
|
+
hoverActions: [{
|
|
1295
|
+
commandId: "workbench.action.terminal.learnMore" ,
|
|
1296
|
+
label: ( localize(9061, "Learn more about shell integration")),
|
|
1297
|
+
run: () => {
|
|
1298
|
+
this._openerService.open('https://code.visualstudio.com/docs/editor/integrated-terminal#_shell-integration');
|
|
1299
|
+
}
|
|
1300
|
+
}, {
|
|
1301
|
+
commandId: 'workbench.action.openSettings',
|
|
1302
|
+
label: ( localize(9062, "Open user settings")),
|
|
1303
|
+
run: () => {
|
|
1304
|
+
this._commandService.executeCommand('workbench.action.openSettings', 'terminal.integrated.shellIntegration.enabled');
|
|
1305
|
+
}
|
|
1306
|
+
}]
|
|
1307
|
+
});
|
|
1308
|
+
this._telemetryService.publicLog2('terminal/shellIntegrationFailureProcessExit');
|
|
1309
|
+
}
|
|
1310
|
+
_flushXtermData() {
|
|
1311
|
+
if (this._latestXtermWriteData === this._latestXtermParseData) {
|
|
1312
|
+
return Promise.resolve();
|
|
1313
|
+
}
|
|
1314
|
+
let retries = 0;
|
|
1315
|
+
return (
|
|
1316
|
+
(new Promise(r => {
|
|
1317
|
+
const interval = disposableWindowInterval(getActiveWindow().window, () => {
|
|
1318
|
+
if (this._latestXtermWriteData === this._latestXtermParseData || ++retries === 5) {
|
|
1319
|
+
interval.dispose();
|
|
1320
|
+
r();
|
|
1321
|
+
}
|
|
1322
|
+
}, 20);
|
|
1323
|
+
}))
|
|
1324
|
+
);
|
|
1325
|
+
}
|
|
1326
|
+
_attachPressAnyKeyToCloseListener(xterm) {
|
|
1327
|
+
if (xterm.textarea && !this._pressAnyKeyToCloseListener) {
|
|
1328
|
+
this._pressAnyKeyToCloseListener = addDisposableListener(xterm.textarea, 'keypress', (event) => {
|
|
1329
|
+
if (this._pressAnyKeyToCloseListener) {
|
|
1330
|
+
this._pressAnyKeyToCloseListener.dispose();
|
|
1331
|
+
this._pressAnyKeyToCloseListener = undefined;
|
|
1332
|
+
this.dispose(TerminalExitReason.Process);
|
|
1333
|
+
event.preventDefault();
|
|
1334
|
+
}
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
_writeInitialText(xterm, callback) {
|
|
1339
|
+
if (!this._shellLaunchConfig.initialText) {
|
|
1340
|
+
callback?.();
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1343
|
+
const text = typeof this._shellLaunchConfig.initialText === 'string'
|
|
1344
|
+
? this._shellLaunchConfig.initialText
|
|
1345
|
+
: this._shellLaunchConfig.initialText?.text;
|
|
1346
|
+
if (typeof this._shellLaunchConfig.initialText === 'string') {
|
|
1347
|
+
xterm.raw.writeln(text, callback);
|
|
1348
|
+
}
|
|
1349
|
+
else {
|
|
1350
|
+
if (this._shellLaunchConfig.initialText.trailingNewLine) {
|
|
1351
|
+
xterm.raw.writeln(text, callback);
|
|
1352
|
+
}
|
|
1353
|
+
else {
|
|
1354
|
+
xterm.raw.write(text, callback);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
async reuseTerminal(shell, reset = false) {
|
|
1359
|
+
this._pressAnyKeyToCloseListener?.dispose();
|
|
1360
|
+
this._pressAnyKeyToCloseListener = undefined;
|
|
1361
|
+
const xterm = this.xterm;
|
|
1362
|
+
if (xterm) {
|
|
1363
|
+
if (!reset) {
|
|
1364
|
+
await ( (new Promise(r => xterm.raw.write('\n\x1b[G', r))));
|
|
1365
|
+
}
|
|
1366
|
+
if (shell.initialText) {
|
|
1367
|
+
this._shellLaunchConfig.initialText = shell.initialText;
|
|
1368
|
+
await ( (new Promise(r => this._writeInitialText(xterm, r))));
|
|
1369
|
+
}
|
|
1370
|
+
if (this._isExiting && this._shellLaunchConfig.waitOnExit) {
|
|
1371
|
+
xterm.raw.options.disableStdin = false;
|
|
1372
|
+
this._isExiting = false;
|
|
1373
|
+
}
|
|
1374
|
+
if (reset) {
|
|
1375
|
+
xterm.clearDecorations();
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
this.statusList.remove("relaunch-needed" );
|
|
1379
|
+
if (!reset) {
|
|
1380
|
+
shell.initialText = ' ';
|
|
1381
|
+
}
|
|
1382
|
+
this._shellLaunchConfig = shell;
|
|
1383
|
+
await this._processManager.relaunch(this._shellLaunchConfig, this._cols || 80 , this._rows || 30 , reset).then(result => {
|
|
1384
|
+
if (result) {
|
|
1385
|
+
if ('message' in result) {
|
|
1386
|
+
this._onProcessExit(result);
|
|
1387
|
+
}
|
|
1388
|
+
else if ('injectedArgs' in result) {
|
|
1389
|
+
this._injectedArgs = result.injectedArgs;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
relaunch() {
|
|
1395
|
+
this.reuseTerminal(this._shellLaunchConfig, true);
|
|
1396
|
+
}
|
|
1397
|
+
_onTitleChange(title) {
|
|
1398
|
+
if (this.isTitleSetByProcess) {
|
|
1399
|
+
this._setTitle(title, TitleEventSource.Sequence);
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
async _trust() {
|
|
1403
|
+
return (await this._workspaceTrustRequestService.requestWorkspaceTrust({
|
|
1404
|
+
message: ( localize(9063, "Creating a terminal process requires executing code"))
|
|
1405
|
+
})) === true;
|
|
1406
|
+
}
|
|
1407
|
+
async _onSelectionChange() {
|
|
1408
|
+
this._onDidChangeSelection.fire(this);
|
|
1409
|
+
if (this._configurationService.getValue("terminal.integrated.copyOnSelection" )) {
|
|
1410
|
+
if (this._overrideCopySelection === false) {
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
if (this.hasSelection()) {
|
|
1414
|
+
await this.copySelection();
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
overrideCopyOnSelection(value) {
|
|
1419
|
+
if (this._overrideCopySelection !== undefined) {
|
|
1420
|
+
throw ( (new Error('Cannot set a copy on selection override multiple times')));
|
|
1421
|
+
}
|
|
1422
|
+
this._overrideCopySelection = value;
|
|
1423
|
+
return toDisposable(() => this._overrideCopySelection = undefined);
|
|
1424
|
+
}
|
|
1425
|
+
async _updateProcessCwd() {
|
|
1426
|
+
if (this.isDisposed || this.shellLaunchConfig.customPtyImplementation) {
|
|
1427
|
+
return;
|
|
1428
|
+
}
|
|
1429
|
+
try {
|
|
1430
|
+
const cwd = await this._refreshProperty("cwd" );
|
|
1431
|
+
if (typeof cwd !== 'string') {
|
|
1432
|
+
throw ( (new Error(`cwd is not a string ${cwd}`)));
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
catch (e) {
|
|
1436
|
+
if (e instanceof Error && e.message === 'Cannot refresh property when process is not set') {
|
|
1437
|
+
return;
|
|
1438
|
+
}
|
|
1439
|
+
throw e;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
updateConfig() {
|
|
1443
|
+
this._setCommandsToSkipShell(this._terminalConfigurationService.config.commandsToSkipShell);
|
|
1444
|
+
this._refreshEnvironmentVariableInfoWidgetState(this._processManager.environmentVariableInfo);
|
|
1445
|
+
}
|
|
1446
|
+
async _updateUnicodeVersion() {
|
|
1447
|
+
this._processManager.setUnicodeVersion(this._terminalConfigurationService.config.unicodeVersion);
|
|
1448
|
+
}
|
|
1449
|
+
updateAccessibilitySupport() {
|
|
1450
|
+
this.xterm.raw.options.screenReaderMode = this._accessibilityService.isScreenReaderOptimized();
|
|
1451
|
+
}
|
|
1452
|
+
_setCommandsToSkipShell(commands) {
|
|
1453
|
+
const excludeCommands = ( (commands.filter(command => command[0] === '-').map(command => command.slice(1))));
|
|
1454
|
+
this._skipTerminalCommands = DEFAULT_COMMANDS_TO_SKIP_SHELL.filter(defaultCommand => {
|
|
1455
|
+
return !excludeCommands.includes(defaultCommand);
|
|
1456
|
+
}).concat(commands);
|
|
1457
|
+
}
|
|
1458
|
+
layout(dimension) {
|
|
1459
|
+
this._lastLayoutDimensions = dimension;
|
|
1460
|
+
if (this.disableLayout) {
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1463
|
+
if (dimension.width <= 0 || dimension.height <= 0) {
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1466
|
+
const terminalWidth = this._evaluateColsAndRows(dimension.width, dimension.height);
|
|
1467
|
+
if (!terminalWidth) {
|
|
1468
|
+
return;
|
|
1469
|
+
}
|
|
1470
|
+
this._resize();
|
|
1471
|
+
if (!this._containerReadyBarrier.isOpen()) {
|
|
1472
|
+
this._containerReadyBarrier.open();
|
|
1473
|
+
}
|
|
1474
|
+
for (const contribution of ( (this._contributions.values()))) {
|
|
1475
|
+
if (!this.xterm) {
|
|
1476
|
+
this._xtermReadyPromise.then(xterm => contribution.layout?.(xterm, dimension));
|
|
1477
|
+
}
|
|
1478
|
+
else {
|
|
1479
|
+
contribution.layout?.(this.xterm, dimension);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
async _resize(immediate) {
|
|
1484
|
+
if (!this.xterm) {
|
|
1485
|
+
return;
|
|
1486
|
+
}
|
|
1487
|
+
let cols = this.cols;
|
|
1488
|
+
let rows = this.rows;
|
|
1489
|
+
if (this._isVisible && this._layoutSettingsChanged) {
|
|
1490
|
+
const font = this.xterm.getFont();
|
|
1491
|
+
const config = this._terminalConfigurationService.config;
|
|
1492
|
+
this.xterm.raw.options.letterSpacing = font.letterSpacing;
|
|
1493
|
+
this.xterm.raw.options.lineHeight = font.lineHeight;
|
|
1494
|
+
this.xterm.raw.options.fontSize = font.fontSize;
|
|
1495
|
+
this.xterm.raw.options.fontFamily = font.fontFamily;
|
|
1496
|
+
this.xterm.raw.options.fontWeight = config.fontWeight;
|
|
1497
|
+
this.xterm.raw.options.fontWeightBold = config.fontWeightBold;
|
|
1498
|
+
this._initDimensions();
|
|
1499
|
+
cols = this.cols;
|
|
1500
|
+
rows = this.rows;
|
|
1501
|
+
this._layoutSettingsChanged = false;
|
|
1502
|
+
}
|
|
1503
|
+
if (isNaN(cols) || isNaN(rows)) {
|
|
1504
|
+
return;
|
|
1505
|
+
}
|
|
1506
|
+
if (cols !== this.xterm.raw.cols || rows !== this.xterm.raw.rows) {
|
|
1507
|
+
if (this._fixedRows || this._fixedCols) {
|
|
1508
|
+
await this._updateProperty("fixedDimensions" , { cols: this._fixedCols, rows: this._fixedRows });
|
|
1509
|
+
}
|
|
1510
|
+
this._onDimensionsChanged.fire();
|
|
1511
|
+
}
|
|
1512
|
+
TerminalInstance_1._lastKnownGridDimensions = { cols, rows };
|
|
1513
|
+
this._resizeDebouncer.resize(cols, rows, immediate ?? false);
|
|
1514
|
+
}
|
|
1515
|
+
async _updatePtyDimensions(rawXterm) {
|
|
1516
|
+
await this._processManager.setDimensions(rawXterm.cols, rawXterm.rows);
|
|
1517
|
+
}
|
|
1518
|
+
setShellType(shellType) {
|
|
1519
|
+
if (this._shellType === shellType) {
|
|
1520
|
+
return;
|
|
1521
|
+
}
|
|
1522
|
+
if (shellType) {
|
|
1523
|
+
this._shellType = shellType;
|
|
1524
|
+
this._terminalShellTypeContextKey.set(shellType?.toString());
|
|
1525
|
+
this._onDidChangeShellType.fire(shellType);
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
_setAriaLabel(xterm, terminalId, title) {
|
|
1529
|
+
const labelParts = [];
|
|
1530
|
+
if (xterm && xterm.textarea) {
|
|
1531
|
+
if (title && title.length > 0) {
|
|
1532
|
+
labelParts.push(( localize(9064, "Terminal {0}, {1}", terminalId, title)));
|
|
1533
|
+
}
|
|
1534
|
+
else {
|
|
1535
|
+
labelParts.push(( localize(9065, "Terminal {0}", terminalId)));
|
|
1536
|
+
}
|
|
1537
|
+
const screenReaderOptimized = this._accessibilityService.isScreenReaderOptimized();
|
|
1538
|
+
if (!screenReaderOptimized) {
|
|
1539
|
+
labelParts.push(( localize(
|
|
1540
|
+
9066,
|
|
1541
|
+
"Run the command: Toggle Screen Reader Accessibility Mode for an optimized screen reader experience"
|
|
1542
|
+
)));
|
|
1543
|
+
}
|
|
1544
|
+
const accessibilityHelpKeybinding = this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp" )?.getLabel();
|
|
1545
|
+
if (this._configurationService.getValue("accessibility.verbosity.terminal" ) && accessibilityHelpKeybinding) {
|
|
1546
|
+
labelParts.push(( localize(
|
|
1547
|
+
9067,
|
|
1548
|
+
"Use {0} for terminal accessibility help",
|
|
1549
|
+
accessibilityHelpKeybinding
|
|
1550
|
+
)));
|
|
1551
|
+
}
|
|
1552
|
+
xterm.textarea.setAttribute('aria-label', labelParts.join('\n'));
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
_updateTitleProperties(title, eventSource) {
|
|
1556
|
+
if (!title) {
|
|
1557
|
+
return this._processName;
|
|
1558
|
+
}
|
|
1559
|
+
switch (eventSource) {
|
|
1560
|
+
case TitleEventSource.Process:
|
|
1561
|
+
if (this._processManager.os === 1 ) {
|
|
1562
|
+
title = win32.parse(title).name;
|
|
1563
|
+
}
|
|
1564
|
+
else {
|
|
1565
|
+
const firstSpaceIndex = title.indexOf(' ');
|
|
1566
|
+
if (title.startsWith('/')) {
|
|
1567
|
+
title = basename(title);
|
|
1568
|
+
}
|
|
1569
|
+
else if (firstSpaceIndex > -1) {
|
|
1570
|
+
title = title.substring(0, firstSpaceIndex);
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
this._processName = title;
|
|
1574
|
+
break;
|
|
1575
|
+
case TitleEventSource.Api:
|
|
1576
|
+
this._staticTitle = title;
|
|
1577
|
+
this._messageTitleDisposable.value = undefined;
|
|
1578
|
+
break;
|
|
1579
|
+
case TitleEventSource.Sequence:
|
|
1580
|
+
this._sequence = title;
|
|
1581
|
+
if (this._processManager.os === 1 &&
|
|
1582
|
+
title.match(/^[a-zA-Z]:\\.+\.[a-zA-Z]{1,3}/)) {
|
|
1583
|
+
this._sequence = win32.parse(title).name;
|
|
1584
|
+
}
|
|
1585
|
+
break;
|
|
1586
|
+
}
|
|
1587
|
+
this._titleSource = eventSource;
|
|
1588
|
+
return title;
|
|
1589
|
+
}
|
|
1590
|
+
setOverrideDimensions(dimensions, immediate = false) {
|
|
1591
|
+
if (this._dimensionsOverride && this._dimensionsOverride.forceExactSize && !dimensions && this._rows === 0 && this._cols === 0) {
|
|
1592
|
+
this._cols = this._dimensionsOverride.cols;
|
|
1593
|
+
this._rows = this._dimensionsOverride.rows;
|
|
1594
|
+
}
|
|
1595
|
+
this._dimensionsOverride = dimensions;
|
|
1596
|
+
if (immediate) {
|
|
1597
|
+
this._resize(true);
|
|
1598
|
+
}
|
|
1599
|
+
else {
|
|
1600
|
+
this._resize();
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
async setFixedDimensions() {
|
|
1604
|
+
const cols = await this._quickInputService.input({
|
|
1605
|
+
title: ( localize(9068, "Set Fixed Dimensions: Column")),
|
|
1606
|
+
placeHolder: 'Enter a number of columns or leave empty for automatic width',
|
|
1607
|
+
validateInput: async (text) => text.length > 0 && !text.match(/^\d+$/) ? { content: 'Enter a number or leave empty size automatically', severity: Severity$1.Error } : undefined
|
|
1608
|
+
});
|
|
1609
|
+
if (cols === undefined) {
|
|
1610
|
+
return;
|
|
1611
|
+
}
|
|
1612
|
+
this._fixedCols = this._parseFixedDimension(cols);
|
|
1613
|
+
this._labelComputer?.refreshLabel(this);
|
|
1614
|
+
this._terminalHasFixedWidth.set(!!this._fixedCols);
|
|
1615
|
+
const rows = await this._quickInputService.input({
|
|
1616
|
+
title: ( localize(9069, "Set Fixed Dimensions: Row")),
|
|
1617
|
+
placeHolder: 'Enter a number of rows or leave empty for automatic height',
|
|
1618
|
+
validateInput: async (text) => text.length > 0 && !text.match(/^\d+$/) ? { content: 'Enter a number or leave empty size automatically', severity: Severity$1.Error } : undefined
|
|
1619
|
+
});
|
|
1620
|
+
if (rows === undefined) {
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1623
|
+
this._fixedRows = this._parseFixedDimension(rows);
|
|
1624
|
+
this._labelComputer?.refreshLabel(this);
|
|
1625
|
+
await this._refreshScrollbar();
|
|
1626
|
+
this._resize();
|
|
1627
|
+
this.focus();
|
|
1628
|
+
}
|
|
1629
|
+
_parseFixedDimension(value) {
|
|
1630
|
+
if (value === '') {
|
|
1631
|
+
return undefined;
|
|
1632
|
+
}
|
|
1633
|
+
const parsed = parseInt(value);
|
|
1634
|
+
if (parsed <= 0) {
|
|
1635
|
+
throw ( (new Error(`Could not parse dimension "${value}"`)));
|
|
1636
|
+
}
|
|
1637
|
+
return parsed;
|
|
1638
|
+
}
|
|
1639
|
+
async toggleSizeToContentWidth() {
|
|
1640
|
+
if (!this.xterm?.raw.buffer.active) {
|
|
1641
|
+
return;
|
|
1642
|
+
}
|
|
1643
|
+
if (this._hasScrollBar) {
|
|
1644
|
+
this._terminalHasFixedWidth.set(false);
|
|
1645
|
+
this._fixedCols = undefined;
|
|
1646
|
+
this._fixedRows = undefined;
|
|
1647
|
+
this._hasScrollBar = false;
|
|
1648
|
+
this._initDimensions();
|
|
1649
|
+
await this._resize();
|
|
1650
|
+
}
|
|
1651
|
+
else {
|
|
1652
|
+
const font = this.xterm ? this.xterm.getFont() : this._terminalConfigurationService.getFont(getWindow(this.domElement));
|
|
1653
|
+
const maxColsForTexture = Math.floor(4096 / (font.charWidth ?? 20));
|
|
1654
|
+
const proposedCols = Math.max(this.maxCols, Math.min(this.xterm.getLongestViewportWrappedLineLength(), maxColsForTexture));
|
|
1655
|
+
if (proposedCols > this.xterm.raw.cols) {
|
|
1656
|
+
this._fixedCols = proposedCols;
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
await this._refreshScrollbar();
|
|
1660
|
+
this._labelComputer?.refreshLabel(this);
|
|
1661
|
+
this.focus();
|
|
1662
|
+
}
|
|
1663
|
+
_refreshScrollbar() {
|
|
1664
|
+
if (this._fixedCols || this._fixedRows) {
|
|
1665
|
+
return this._addScrollbar();
|
|
1666
|
+
}
|
|
1667
|
+
return this._removeScrollbar();
|
|
1668
|
+
}
|
|
1669
|
+
async _addScrollbar() {
|
|
1670
|
+
const charWidth = (this.xterm ? this.xterm.getFont() : this._terminalConfigurationService.getFont(getWindow(this.domElement))).charWidth;
|
|
1671
|
+
if (!this.xterm?.raw.element || !this._container || !charWidth || !this._fixedCols) {
|
|
1672
|
+
return;
|
|
1673
|
+
}
|
|
1674
|
+
this._wrapperElement.classList.add('fixed-dims');
|
|
1675
|
+
this._hasScrollBar = true;
|
|
1676
|
+
this._initDimensions();
|
|
1677
|
+
await this._resize();
|
|
1678
|
+
this._terminalHasFixedWidth.set(true);
|
|
1679
|
+
if (!this._horizontalScrollbar) {
|
|
1680
|
+
this._horizontalScrollbar = this._register(( (new DomScrollableElement(this._wrapperElement, {
|
|
1681
|
+
vertical: 2 ,
|
|
1682
|
+
horizontal: 1 ,
|
|
1683
|
+
useShadows: false,
|
|
1684
|
+
scrollYToX: false,
|
|
1685
|
+
consumeMouseWheelIfScrollbarIsNeeded: false
|
|
1686
|
+
}))));
|
|
1687
|
+
this._container.appendChild(this._horizontalScrollbar.getDomNode());
|
|
1688
|
+
}
|
|
1689
|
+
this._horizontalScrollbar.setScrollDimensions({
|
|
1690
|
+
width: this.xterm.raw.element.clientWidth,
|
|
1691
|
+
scrollWidth: this._fixedCols * charWidth + 40
|
|
1692
|
+
});
|
|
1693
|
+
this._horizontalScrollbar.getDomNode().style.paddingBottom = '16px';
|
|
1694
|
+
if (isWindows) {
|
|
1695
|
+
for (let i = this.xterm.raw.buffer.active.viewportY; i < this.xterm.raw.buffer.active.length; i++) {
|
|
1696
|
+
const line = this.xterm.raw.buffer.active.getLine(i);
|
|
1697
|
+
line._line.isWrapped = false;
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
async _removeScrollbar() {
|
|
1702
|
+
if (!this._container || !this._horizontalScrollbar) {
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
this._horizontalScrollbar.getDomNode().remove();
|
|
1706
|
+
this._horizontalScrollbar.dispose();
|
|
1707
|
+
this._horizontalScrollbar = undefined;
|
|
1708
|
+
this._wrapperElement.remove();
|
|
1709
|
+
this._wrapperElement.classList.remove('fixed-dims');
|
|
1710
|
+
this._container.appendChild(this._wrapperElement);
|
|
1711
|
+
}
|
|
1712
|
+
_setResolvedShellLaunchConfig(shellLaunchConfig) {
|
|
1713
|
+
this._shellLaunchConfig.args = shellLaunchConfig.args;
|
|
1714
|
+
this._shellLaunchConfig.cwd = shellLaunchConfig.cwd;
|
|
1715
|
+
this._shellLaunchConfig.executable = shellLaunchConfig.executable;
|
|
1716
|
+
this._shellLaunchConfig.env = shellLaunchConfig.env;
|
|
1717
|
+
}
|
|
1718
|
+
_onEnvironmentVariableInfoChanged(info) {
|
|
1719
|
+
if (info.requiresAction) {
|
|
1720
|
+
this.xterm?.raw.textarea?.setAttribute('aria-label', ( localize(
|
|
1721
|
+
9070,
|
|
1722
|
+
"Terminal {0} environment is stale, run the 'Show Environment Information' command for more information",
|
|
1723
|
+
this._instanceId
|
|
1724
|
+
)));
|
|
1725
|
+
}
|
|
1726
|
+
this._refreshEnvironmentVariableInfoWidgetState(info);
|
|
1727
|
+
}
|
|
1728
|
+
async _refreshEnvironmentVariableInfoWidgetState(info) {
|
|
1729
|
+
if (!info) {
|
|
1730
|
+
this.statusList.remove("relaunch-needed" );
|
|
1731
|
+
this.statusList.remove("env-var-info-changes-active" );
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
if (
|
|
1735
|
+
info.requiresAction &&
|
|
1736
|
+
this._terminalConfigurationService.config.environmentChangesRelaunch &&
|
|
1737
|
+
!this._processManager.hasWrittenData &&
|
|
1738
|
+
(!this._shellLaunchConfig.isFeatureTerminal || (this.reconnectionProperties && this._configurationService.getValue('task.reconnection') === true)) &&
|
|
1739
|
+
!this._shellLaunchConfig.customPtyImplementation &&
|
|
1740
|
+
!this._shellLaunchConfig.isExtensionOwnedTerminal &&
|
|
1741
|
+
!this._shellLaunchConfig.attachPersistentProcess &&
|
|
1742
|
+
!((this._processManager.remoteAuthority && this._terminalConfigurationService.config.windowsEnableConpty && (await this._processManager.getBackendOS()) === 1) )) {
|
|
1743
|
+
this.relaunch();
|
|
1744
|
+
return;
|
|
1745
|
+
}
|
|
1746
|
+
const workspaceFolder = getWorkspaceForTerminal(this.shellLaunchConfig.cwd, this._workspaceContextService, this._historyService);
|
|
1747
|
+
this.statusList.add(info.getStatus({ workspaceFolder }));
|
|
1748
|
+
}
|
|
1749
|
+
async getInitialCwd() {
|
|
1750
|
+
if (!this._initialCwd) {
|
|
1751
|
+
this._initialCwd = this._processManager.initialCwd;
|
|
1752
|
+
}
|
|
1753
|
+
return this._initialCwd;
|
|
1754
|
+
}
|
|
1755
|
+
async getCwd() {
|
|
1756
|
+
if (( (this.capabilities.has(0 )))) {
|
|
1757
|
+
return this.capabilities.get(0 ).getCwd();
|
|
1758
|
+
}
|
|
1759
|
+
else if (( (this.capabilities.has(1 )))) {
|
|
1760
|
+
return this.capabilities.get(1 ).getCwd();
|
|
1761
|
+
}
|
|
1762
|
+
return this._processManager.initialCwd;
|
|
1763
|
+
}
|
|
1764
|
+
async _refreshProperty(type) {
|
|
1765
|
+
await this.processReady;
|
|
1766
|
+
return this._processManager.refreshProperty(type);
|
|
1767
|
+
}
|
|
1768
|
+
async _updateProperty(type, value) {
|
|
1769
|
+
return this._processManager.updateProperty(type, value);
|
|
1770
|
+
}
|
|
1771
|
+
async rename(title) {
|
|
1772
|
+
this._setTitle(title, TitleEventSource.Api);
|
|
1773
|
+
}
|
|
1774
|
+
_setTitle(title, eventSource) {
|
|
1775
|
+
const reset = !title;
|
|
1776
|
+
title = this._updateTitleProperties(title, eventSource);
|
|
1777
|
+
const titleChanged = title !== this._title;
|
|
1778
|
+
this._title = title;
|
|
1779
|
+
this._labelComputer?.refreshLabel(this, reset);
|
|
1780
|
+
this._setAriaLabel(this.xterm?.raw, this._instanceId, this._title);
|
|
1781
|
+
if (titleChanged) {
|
|
1782
|
+
this._onTitleChanged.fire(this);
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
async changeIcon(icon) {
|
|
1786
|
+
if (icon) {
|
|
1787
|
+
this._icon = icon;
|
|
1788
|
+
this._onIconChanged.fire({ instance: this, userInitiated: true });
|
|
1789
|
+
return icon;
|
|
1790
|
+
}
|
|
1791
|
+
const iconPicker = this._scopedInstantiationService.createInstance(TerminalIconPicker);
|
|
1792
|
+
const pickedIcon = await iconPicker.pickIcons();
|
|
1793
|
+
iconPicker.dispose();
|
|
1794
|
+
if (!pickedIcon) {
|
|
1795
|
+
return undefined;
|
|
1796
|
+
}
|
|
1797
|
+
this._icon = pickedIcon;
|
|
1798
|
+
this._onIconChanged.fire({ instance: this, userInitiated: true });
|
|
1799
|
+
return pickedIcon;
|
|
1800
|
+
}
|
|
1801
|
+
async changeColor(color, skipQuickPick) {
|
|
1802
|
+
if (color) {
|
|
1803
|
+
this.shellLaunchConfig.color = color;
|
|
1804
|
+
this._onIconChanged.fire({ instance: this, userInitiated: true });
|
|
1805
|
+
return color;
|
|
1806
|
+
}
|
|
1807
|
+
else if (skipQuickPick) {
|
|
1808
|
+
this.shellLaunchConfig.color = '';
|
|
1809
|
+
this._onIconChanged.fire({ instance: this, userInitiated: true });
|
|
1810
|
+
return;
|
|
1811
|
+
}
|
|
1812
|
+
const icon = this._getIcon();
|
|
1813
|
+
if (!icon) {
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
const colorTheme = this._themeService.getColorTheme();
|
|
1817
|
+
const standardColors = getStandardColors(colorTheme);
|
|
1818
|
+
const colorStyleDisposable = createColorStyleElement(colorTheme);
|
|
1819
|
+
const items = [];
|
|
1820
|
+
for (const colorKey of standardColors) {
|
|
1821
|
+
const colorClass = getColorClass(colorKey);
|
|
1822
|
+
items.push({
|
|
1823
|
+
label: `$(${Codicon.circleFilled.id}) ${colorKey.replace('terminal.ansi', '')}`, id: colorKey, description: colorKey, iconClasses: [colorClass]
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1826
|
+
items.push({ type: 'separator' });
|
|
1827
|
+
const showAllColorsItem = { label: 'Reset to default' };
|
|
1828
|
+
items.push(showAllColorsItem);
|
|
1829
|
+
const disposables = [];
|
|
1830
|
+
const quickPick = this._quickInputService.createQuickPick({ useSeparators: true });
|
|
1831
|
+
disposables.push(quickPick);
|
|
1832
|
+
quickPick.items = items;
|
|
1833
|
+
quickPick.matchOnDescription = true;
|
|
1834
|
+
quickPick.placeholder = ( localize(9071, 'Select a color for the terminal'));
|
|
1835
|
+
quickPick.show();
|
|
1836
|
+
const result = await ( (new Promise(r => {
|
|
1837
|
+
disposables.push(quickPick.onDidHide(() => r(undefined)));
|
|
1838
|
+
disposables.push(quickPick.onDidAccept(() => r(quickPick.selectedItems[0])));
|
|
1839
|
+
})));
|
|
1840
|
+
dispose(disposables);
|
|
1841
|
+
if (result) {
|
|
1842
|
+
this.shellLaunchConfig.color = result.id;
|
|
1843
|
+
this._onIconChanged.fire({ instance: this, userInitiated: true });
|
|
1844
|
+
}
|
|
1845
|
+
quickPick.hide();
|
|
1846
|
+
colorStyleDisposable.dispose();
|
|
1847
|
+
return result?.id;
|
|
1848
|
+
}
|
|
1849
|
+
forceScrollbarVisibility() {
|
|
1850
|
+
this._wrapperElement.classList.add('force-scrollbar');
|
|
1851
|
+
}
|
|
1852
|
+
resetScrollbarVisibility() {
|
|
1853
|
+
this._wrapperElement.classList.remove('force-scrollbar');
|
|
1854
|
+
}
|
|
1855
|
+
setParentContextKeyService(parentContextKeyService) {
|
|
1856
|
+
this._scopedContextKeyService.updateParent(parentContextKeyService);
|
|
1857
|
+
}
|
|
1858
|
+
async handleMouseEvent(event, contextMenu) {
|
|
1859
|
+
if (isHTMLElement(event.target) && (event.target.classList.contains('scrollbar') || event.target.classList.contains('slider'))) {
|
|
1860
|
+
return { cancelContextMenu: true };
|
|
1861
|
+
}
|
|
1862
|
+
if (event.which === 2) {
|
|
1863
|
+
switch (this._terminalConfigurationService.config.middleClickBehavior) {
|
|
1864
|
+
case 'paste':
|
|
1865
|
+
this.paste();
|
|
1866
|
+
break;
|
|
1867
|
+
case 'default':
|
|
1868
|
+
default:
|
|
1869
|
+
this.focus();
|
|
1870
|
+
break;
|
|
1871
|
+
}
|
|
1872
|
+
return;
|
|
1873
|
+
}
|
|
1874
|
+
if (event.which === 3) {
|
|
1875
|
+
const rightClickBehavior = this._terminalConfigurationService.config.rightClickBehavior;
|
|
1876
|
+
if (rightClickBehavior === 'nothing') {
|
|
1877
|
+
if (!event.shiftKey) {
|
|
1878
|
+
return { cancelContextMenu: true };
|
|
1879
|
+
}
|
|
1880
|
+
return;
|
|
1881
|
+
}
|
|
1882
|
+
else if (rightClickBehavior === 'copyPaste' || rightClickBehavior === 'paste') {
|
|
1883
|
+
if (rightClickBehavior === 'copyPaste' && event.shiftKey) {
|
|
1884
|
+
openContextMenu(getActiveWindow(), event, this, contextMenu, this._contextMenuService);
|
|
1885
|
+
return;
|
|
1886
|
+
}
|
|
1887
|
+
if (rightClickBehavior === 'copyPaste' && this.hasSelection()) {
|
|
1888
|
+
await this.copySelection();
|
|
1889
|
+
this.clearSelection();
|
|
1890
|
+
}
|
|
1891
|
+
else {
|
|
1892
|
+
if (BrowserFeatures.clipboard.readText) {
|
|
1893
|
+
this.paste();
|
|
1894
|
+
}
|
|
1895
|
+
else {
|
|
1896
|
+
this._notificationService.info(`This browser doesn't support the clipboard.readText API needed to trigger a paste, try ${isMacintosh ? '⌘' : 'Ctrl'}+V instead.`);
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
if (isMacintosh) {
|
|
1900
|
+
setTimeout(() => this.clearSelection(), 0);
|
|
1901
|
+
}
|
|
1902
|
+
return { cancelContextMenu: true };
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
};
|
|
1907
|
+
TerminalInstance.__decorator = ( (__decorate([
|
|
1908
|
+
debounce(50)
|
|
1909
|
+
], TerminalInstance.prototype, "_fireMaximumDimensionsChanged", null)));
|
|
1910
|
+
TerminalInstance.__decorator = ( (__decorate([
|
|
1911
|
+
debounce(1000)
|
|
1912
|
+
], TerminalInstance.prototype, "relaunch", null)));
|
|
1913
|
+
TerminalInstance.__decorator = ( (__decorate([
|
|
1914
|
+
debounce(2000)
|
|
1915
|
+
], TerminalInstance.prototype, "_updateProcessCwd", null)));
|
|
1916
|
+
TerminalInstance = TerminalInstance_1 = ( (__decorate([
|
|
1917
|
+
( (__param(3, IContextKeyService))),
|
|
1918
|
+
( (__param(4, IContextMenuService))),
|
|
1919
|
+
( (__param(5, IInstantiationService))),
|
|
1920
|
+
( (__param(6, ITerminalConfigurationService))),
|
|
1921
|
+
( (__param(7, ITerminalProfileResolverService))),
|
|
1922
|
+
( (__param(8, IPathService))),
|
|
1923
|
+
( (__param(9, IKeybindingService))),
|
|
1924
|
+
( (__param(10, INotificationService))),
|
|
1925
|
+
( (__param(11, IPreferencesService))),
|
|
1926
|
+
( (__param(12, IViewsService))),
|
|
1927
|
+
( (__param(13, IClipboardService))),
|
|
1928
|
+
( (__param(14, IThemeService))),
|
|
1929
|
+
( (__param(15, IConfigurationService))),
|
|
1930
|
+
( (__param(16, ITerminalLogService))),
|
|
1931
|
+
( (__param(17, IStorageService))),
|
|
1932
|
+
( (__param(18, IAccessibilityService))),
|
|
1933
|
+
( (__param(19, IProductService))),
|
|
1934
|
+
( (__param(20, IQuickInputService))),
|
|
1935
|
+
( (__param(21, IWorkbenchEnvironmentService))),
|
|
1936
|
+
( (__param(22, IWorkspaceContextService))),
|
|
1937
|
+
( (__param(23, IEditorService))),
|
|
1938
|
+
( (__param(24, IWorkspaceTrustRequestService))),
|
|
1939
|
+
( (__param(25, IHistoryService))),
|
|
1940
|
+
( (__param(26, ITelemetryService))),
|
|
1941
|
+
( (__param(27, IOpenerService))),
|
|
1942
|
+
( (__param(28, ICommandService))),
|
|
1943
|
+
( (__param(29, IAccessibilitySignalService))),
|
|
1944
|
+
( (__param(30, IViewDescriptorService)))
|
|
1945
|
+
], TerminalInstance)));
|
|
1946
|
+
let TerminalInstanceDragAndDropController = class TerminalInstanceDragAndDropController extends Disposable {
|
|
1947
|
+
get onDropFile() { return this._onDropFile.event; }
|
|
1948
|
+
get onDropTerminal() { return this._onDropTerminal.event; }
|
|
1949
|
+
constructor(_container, _layoutService, _viewDescriptorService, _hostService) {
|
|
1950
|
+
super();
|
|
1951
|
+
this._container = _container;
|
|
1952
|
+
this._layoutService = _layoutService;
|
|
1953
|
+
this._viewDescriptorService = _viewDescriptorService;
|
|
1954
|
+
this._hostService = _hostService;
|
|
1955
|
+
this._onDropFile = this._register(( (new Emitter())));
|
|
1956
|
+
this._onDropTerminal = this._register(( (new Emitter())));
|
|
1957
|
+
this._register(toDisposable(() => this._clearDropOverlay()));
|
|
1958
|
+
}
|
|
1959
|
+
_clearDropOverlay() {
|
|
1960
|
+
this._dropOverlay?.remove();
|
|
1961
|
+
this._dropOverlay = undefined;
|
|
1962
|
+
}
|
|
1963
|
+
onDragEnter(e) {
|
|
1964
|
+
if (!containsDragType(e, DataTransfers.FILES, DataTransfers.RESOURCES, "Terminals" , CodeDataTransfers.FILES)) {
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1967
|
+
if (!this._dropOverlay) {
|
|
1968
|
+
this._dropOverlay = document.createElement('div');
|
|
1969
|
+
this._dropOverlay.classList.add('terminal-drop-overlay');
|
|
1970
|
+
}
|
|
1971
|
+
if (containsDragType(e, "Terminals" )) {
|
|
1972
|
+
const side = this._getDropSide(e);
|
|
1973
|
+
this._dropOverlay.classList.toggle('drop-before', side === 'before');
|
|
1974
|
+
this._dropOverlay.classList.toggle('drop-after', side === 'after');
|
|
1975
|
+
}
|
|
1976
|
+
if (!this._dropOverlay.parentElement) {
|
|
1977
|
+
this._container.appendChild(this._dropOverlay);
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
onDragLeave(e) {
|
|
1981
|
+
this._clearDropOverlay();
|
|
1982
|
+
}
|
|
1983
|
+
onDragEnd(e) {
|
|
1984
|
+
this._clearDropOverlay();
|
|
1985
|
+
}
|
|
1986
|
+
onDragOver(e) {
|
|
1987
|
+
if (!e.dataTransfer || !this._dropOverlay) {
|
|
1988
|
+
return;
|
|
1989
|
+
}
|
|
1990
|
+
if (containsDragType(e, "Terminals" )) {
|
|
1991
|
+
const side = this._getDropSide(e);
|
|
1992
|
+
this._dropOverlay.classList.toggle('drop-before', side === 'before');
|
|
1993
|
+
this._dropOverlay.classList.toggle('drop-after', side === 'after');
|
|
1994
|
+
}
|
|
1995
|
+
this._dropOverlay.style.opacity = '1';
|
|
1996
|
+
}
|
|
1997
|
+
async onDrop(e) {
|
|
1998
|
+
this._clearDropOverlay();
|
|
1999
|
+
if (!e.dataTransfer) {
|
|
2000
|
+
return;
|
|
2001
|
+
}
|
|
2002
|
+
const terminalResources = getTerminalResourcesFromDragEvent(e);
|
|
2003
|
+
if (terminalResources) {
|
|
2004
|
+
for (const uri of terminalResources) {
|
|
2005
|
+
const side = this._getDropSide(e);
|
|
2006
|
+
this._onDropTerminal.fire({ uri, side });
|
|
2007
|
+
}
|
|
2008
|
+
return;
|
|
2009
|
+
}
|
|
2010
|
+
let path;
|
|
2011
|
+
const rawResources = e.dataTransfer.getData(DataTransfers.RESOURCES);
|
|
2012
|
+
if (rawResources) {
|
|
2013
|
+
path = ( (URI.parse(JSON.parse(rawResources)[0])));
|
|
2014
|
+
}
|
|
2015
|
+
const rawCodeFiles = e.dataTransfer.getData(CodeDataTransfers.FILES);
|
|
2016
|
+
if (!path && rawCodeFiles) {
|
|
2017
|
+
path = URI.file(JSON.parse(rawCodeFiles)[0]);
|
|
2018
|
+
}
|
|
2019
|
+
if (!path && e.dataTransfer.files.length > 0 && this._hostService.getPathForFile(e.dataTransfer.files[0])) {
|
|
2020
|
+
path = URI.file(this._hostService.getPathForFile(e.dataTransfer.files[0]));
|
|
2021
|
+
}
|
|
2022
|
+
if (!path) {
|
|
2023
|
+
return;
|
|
2024
|
+
}
|
|
2025
|
+
this._onDropFile.fire(path);
|
|
2026
|
+
}
|
|
2027
|
+
_getDropSide(e) {
|
|
2028
|
+
const target = this._container;
|
|
2029
|
+
if (!target) {
|
|
2030
|
+
return 'after';
|
|
2031
|
+
}
|
|
2032
|
+
const rect = target.getBoundingClientRect();
|
|
2033
|
+
return this._getViewOrientation() === 1
|
|
2034
|
+
? (e.clientX - rect.left < rect.width / 2 ? 'before' : 'after')
|
|
2035
|
+
: (e.clientY - rect.top < rect.height / 2 ? 'before' : 'after');
|
|
2036
|
+
}
|
|
2037
|
+
_getViewOrientation() {
|
|
2038
|
+
const panelPosition = this._layoutService.getPanelPosition();
|
|
2039
|
+
const terminalLocation = this._viewDescriptorService.getViewLocationById(TERMINAL_VIEW_ID);
|
|
2040
|
+
return terminalLocation === 1 && isHorizontal(panelPosition)
|
|
2041
|
+
? 1
|
|
2042
|
+
: 0 ;
|
|
2043
|
+
}
|
|
2044
|
+
};
|
|
2045
|
+
TerminalInstanceDragAndDropController = ( (__decorate([
|
|
2046
|
+
( (__param(1, IWorkbenchLayoutService))),
|
|
2047
|
+
( (__param(2, IViewDescriptorService))),
|
|
2048
|
+
( (__param(3, IHostService)))
|
|
2049
|
+
], TerminalInstanceDragAndDropController)));
|
|
2050
|
+
let TerminalLabelComputer = class TerminalLabelComputer extends Disposable {
|
|
2051
|
+
get title() { return this._title; }
|
|
2052
|
+
get description() { return this._description; }
|
|
2053
|
+
constructor(_fileService, _terminalConfigurationService, _workspaceContextService) {
|
|
2054
|
+
super();
|
|
2055
|
+
this._fileService = _fileService;
|
|
2056
|
+
this._terminalConfigurationService = _terminalConfigurationService;
|
|
2057
|
+
this._workspaceContextService = _workspaceContextService;
|
|
2058
|
+
this._title = '';
|
|
2059
|
+
this._description = '';
|
|
2060
|
+
this._onDidChangeLabel = this._register(( (new Emitter())));
|
|
2061
|
+
this.onDidChangeLabel = this._onDidChangeLabel.event;
|
|
2062
|
+
}
|
|
2063
|
+
refreshLabel(instance, reset) {
|
|
2064
|
+
this._title = this.computeLabel(instance, this._terminalConfigurationService.config.tabs.title, "title" , reset);
|
|
2065
|
+
this._description = this.computeLabel(instance, this._terminalConfigurationService.config.tabs.description, "description" );
|
|
2066
|
+
if (this._title !== instance.title || this._description !== instance.description || reset) {
|
|
2067
|
+
this._onDidChangeLabel.fire({ title: this._title, description: this._description });
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
computeLabel(instance, labelTemplate, labelType, reset) {
|
|
2071
|
+
const type = instance.shellLaunchConfig.attachPersistentProcess?.type || instance.shellLaunchConfig.type;
|
|
2072
|
+
const templateProperties = {
|
|
2073
|
+
cwd: instance.cwd || instance.initialCwd || '',
|
|
2074
|
+
cwdFolder: '',
|
|
2075
|
+
workspaceFolderName: instance.workspaceFolder?.name,
|
|
2076
|
+
workspaceFolder: instance.workspaceFolder ? basename(instance.workspaceFolder.uri.fsPath) : undefined,
|
|
2077
|
+
local: type === 'Local' ? terminalStrings.typeLocal : undefined,
|
|
2078
|
+
process: instance.processName,
|
|
2079
|
+
sequence: instance.sequence,
|
|
2080
|
+
task: type === 'Task' ? terminalStrings.typeTask : undefined,
|
|
2081
|
+
fixedDimensions: instance.fixedCols
|
|
2082
|
+
? (instance.fixedRows ? `\u2194${instance.fixedCols} \u2195${instance.fixedRows}` : `\u2194${instance.fixedCols}`)
|
|
2083
|
+
: (instance.fixedRows ? `\u2195${instance.fixedRows}` : ''),
|
|
2084
|
+
separator: { label: this._terminalConfigurationService.config.tabs.separator }
|
|
2085
|
+
};
|
|
2086
|
+
templateProperties.workspaceFolderName = instance.workspaceFolder?.name ?? templateProperties.workspaceFolder;
|
|
2087
|
+
labelTemplate = labelTemplate.trim();
|
|
2088
|
+
if (!labelTemplate) {
|
|
2089
|
+
return labelType === "title" ? (instance.processName || '') : '';
|
|
2090
|
+
}
|
|
2091
|
+
if (!reset && instance.staticTitle && labelType === "title" ) {
|
|
2092
|
+
return instance.staticTitle.replace(/[\n\r\t]/g, '') || templateProperties.process?.replace(/[\n\r\t]/g, '') || '';
|
|
2093
|
+
}
|
|
2094
|
+
const detection = ( (instance.capabilities.has(0 ))) || ( (instance.capabilities.has(1 )));
|
|
2095
|
+
const folders = this._workspaceContextService.getWorkspace().folders;
|
|
2096
|
+
const multiRootWorkspace = folders.length > 1;
|
|
2097
|
+
if (templateProperties.cwd && detection && ((!instance.shellLaunchConfig.isFeatureTerminal || labelType === "title") )) {
|
|
2098
|
+
const cwdUri = ( (URI.from({
|
|
2099
|
+
scheme: instance.workspaceFolder?.uri.scheme || Schemas.file,
|
|
2100
|
+
path: instance.cwd ? resolve(instance.cwd) : undefined
|
|
2101
|
+
})));
|
|
2102
|
+
let showCwd = false;
|
|
2103
|
+
if (multiRootWorkspace) {
|
|
2104
|
+
showCwd = true;
|
|
2105
|
+
}
|
|
2106
|
+
else if (instance.workspaceFolder?.uri) {
|
|
2107
|
+
const caseSensitive = this._fileService.hasCapability(instance.workspaceFolder.uri, 1024 );
|
|
2108
|
+
showCwd = cwdUri.fsPath.localeCompare(instance.workspaceFolder.uri.fsPath, undefined, { sensitivity: caseSensitive ? 'case' : 'base' }) !== 0;
|
|
2109
|
+
}
|
|
2110
|
+
if (showCwd) {
|
|
2111
|
+
templateProperties.cwdFolder = basename(templateProperties.cwd);
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
const label = template(labelTemplate, templateProperties).replace(/[\n\r\t]/g, '').trim();
|
|
2115
|
+
return label === '' && labelType === "title" ? (instance.processName || '') : label;
|
|
2116
|
+
}
|
|
2117
|
+
};
|
|
2118
|
+
TerminalLabelComputer = ( (__decorate([
|
|
2119
|
+
( (__param(0, IFileService))),
|
|
2120
|
+
( (__param(1, ITerminalConfigurationService))),
|
|
2121
|
+
( (__param(2, IWorkspaceContextService)))
|
|
2122
|
+
], TerminalLabelComputer)));
|
|
2123
|
+
function parseExitResult(exitCodeOrError, shellLaunchConfig, processState, initialCwd) {
|
|
2124
|
+
if (exitCodeOrError === undefined || exitCodeOrError === 0) {
|
|
2125
|
+
return { code: exitCodeOrError, message: undefined };
|
|
2126
|
+
}
|
|
2127
|
+
const code = typeof exitCodeOrError === 'number' ? exitCodeOrError : exitCodeOrError.code;
|
|
2128
|
+
let message = undefined;
|
|
2129
|
+
switch (typeof exitCodeOrError) {
|
|
2130
|
+
case 'number': {
|
|
2131
|
+
let commandLine = undefined;
|
|
2132
|
+
if (shellLaunchConfig.executable) {
|
|
2133
|
+
commandLine = shellLaunchConfig.executable;
|
|
2134
|
+
if (typeof shellLaunchConfig.args === 'string') {
|
|
2135
|
+
commandLine += ` ${shellLaunchConfig.args}`;
|
|
2136
|
+
}
|
|
2137
|
+
else if (shellLaunchConfig.args && shellLaunchConfig.args.length) {
|
|
2138
|
+
commandLine += ( (shellLaunchConfig.args.map(a => ` '${a}'`))).join();
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
if (processState === 4 ) {
|
|
2142
|
+
if (commandLine) {
|
|
2143
|
+
message = ( localize(
|
|
2144
|
+
9072,
|
|
2145
|
+
"The terminal process \"{0}\" failed to launch (exit code: {1}).",
|
|
2146
|
+
commandLine,
|
|
2147
|
+
code
|
|
2148
|
+
));
|
|
2149
|
+
}
|
|
2150
|
+
else {
|
|
2151
|
+
message = ( localize(9073, "The terminal process failed to launch (exit code: {0}).", code));
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
else {
|
|
2155
|
+
if (commandLine) {
|
|
2156
|
+
message = ( localize(
|
|
2157
|
+
9074,
|
|
2158
|
+
"The terminal process \"{0}\" terminated with exit code: {1}.",
|
|
2159
|
+
commandLine,
|
|
2160
|
+
code
|
|
2161
|
+
));
|
|
2162
|
+
}
|
|
2163
|
+
else {
|
|
2164
|
+
message = ( localize(9075, "The terminal process terminated with exit code: {0}.", code));
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
break;
|
|
2168
|
+
}
|
|
2169
|
+
case 'object': {
|
|
2170
|
+
if (( (exitCodeOrError.message.toString())).includes('Could not find pty with id')) {
|
|
2171
|
+
break;
|
|
2172
|
+
}
|
|
2173
|
+
let innerMessage = exitCodeOrError.message;
|
|
2174
|
+
const conptyError = exitCodeOrError.message.match(/.*error code:\s*(\d+).*$/);
|
|
2175
|
+
if (conptyError) {
|
|
2176
|
+
const errorCode = conptyError.length > 1 ? parseInt(conptyError[1]) : undefined;
|
|
2177
|
+
switch (errorCode) {
|
|
2178
|
+
case 5:
|
|
2179
|
+
innerMessage = `Access was denied to the path containing your executable "${shellLaunchConfig.executable}". Manage and change your permissions to get this to work`;
|
|
2180
|
+
break;
|
|
2181
|
+
case 267:
|
|
2182
|
+
innerMessage = `Invalid starting directory "${initialCwd}", review your terminal.integrated.cwd setting`;
|
|
2183
|
+
break;
|
|
2184
|
+
case 1260:
|
|
2185
|
+
innerMessage = `Windows cannot open this program because it has been prevented by a software restriction policy. For more information, open Event Viewer or contact your system Administrator`;
|
|
2186
|
+
break;
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
message = ( localize(9076, "The terminal process failed to launch: {0}.", innerMessage));
|
|
2190
|
+
break;
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
return { code, message };
|
|
2194
|
+
}
|
|
2195
|
+
let TerminalInstanceColorProvider = class TerminalInstanceColorProvider {
|
|
2196
|
+
constructor(_instance, _viewDescriptorService) {
|
|
2197
|
+
this._instance = _instance;
|
|
2198
|
+
this._viewDescriptorService = _viewDescriptorService;
|
|
2199
|
+
}
|
|
2200
|
+
getBackgroundColor(theme) {
|
|
2201
|
+
const terminalBackground = theme.getColor(TERMINAL_BACKGROUND_COLOR);
|
|
2202
|
+
if (terminalBackground) {
|
|
2203
|
+
return terminalBackground;
|
|
2204
|
+
}
|
|
2205
|
+
if (this._instance.target === TerminalLocation.Editor) {
|
|
2206
|
+
return theme.getColor(editorBackground);
|
|
2207
|
+
}
|
|
2208
|
+
const location = this._viewDescriptorService.getViewLocationById(TERMINAL_VIEW_ID);
|
|
2209
|
+
if (location === 1 ) {
|
|
2210
|
+
return theme.getColor(PANEL_BACKGROUND);
|
|
2211
|
+
}
|
|
2212
|
+
return theme.getColor(SIDE_BAR_BACKGROUND);
|
|
2213
|
+
}
|
|
2214
|
+
};
|
|
2215
|
+
TerminalInstanceColorProvider = ( (__decorate([
|
|
2216
|
+
( (__param(1, IViewDescriptorService)))
|
|
2217
|
+
], TerminalInstanceColorProvider)));
|
|
2218
|
+
export { TerminalInstance, TerminalInstanceColorProvider, TerminalLabelComputer, parseExitResult };
|