@codingame/monaco-vscode-api 10.0.2 → 10.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/README.md +27 -0
  2. package/missing-services.js +7060 -1573
  3. package/monaco.d.ts +1 -1
  4. package/monaco.js +1 -1
  5. package/package.json +8 -15
  6. package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +1 -1
  7. package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -1
  8. package/vscode/src/vs/base/browser/ui/splitview/paneview.js +1 -1
  9. package/vscode/src/vs/base/browser/ui/toolbar/toolbar.js +1 -1
  10. package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +9 -9
  11. package/vscode/src/vs/base/common/date.js +61 -61
  12. package/vscode/src/vs/base/common/errorMessage.js +15 -6
  13. package/vscode/src/vs/base/common/errors.d.ts +3 -1
  14. package/vscode/src/vs/base/common/jsonErrorMessages.js +9 -9
  15. package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
  16. package/vscode/src/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
  17. package/vscode/src/vs/editor/browser/coreCommands.js +3 -3
  18. package/vscode/src/vs/editor/browser/gpu/viewGpuContext.js +1 -1
  19. package/vscode/src/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
  20. package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +1 -1
  21. package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +2 -2
  22. package/vscode/src/vs/editor/browser/widget/diffEditor/commands.js +12 -12
  23. package/vscode/src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
  24. package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
  25. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
  26. package/vscode/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
  27. package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +4 -4
  28. package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
  29. package/vscode/src/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
  30. package/vscode/src/vs/editor/common/config/editorConfigurationSchema.js +51 -51
  31. package/vscode/src/vs/editor/common/config/editorOptions.js +368 -368
  32. package/vscode/src/vs/editor/common/core/editorColorRegistry.js +71 -71
  33. package/vscode/src/vs/editor/common/model/editStack.js +1 -1
  34. package/vscode/src/vs/editor/common/standaloneStrings.js +32 -32
  35. package/vscode/src/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  36. package/vscode/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  37. package/vscode/src/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  38. package/vscode/src/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  39. package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
  40. package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  41. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionCommands.js +28 -28
  42. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  43. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  44. package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  45. package/vscode/src/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  46. package/vscode/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
  47. package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  48. package/vscode/src/vs/editor/contrib/comment/browser/comment.js +6 -6
  49. package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
  50. package/vscode/src/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  51. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +3 -3
  52. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +7 -7
  53. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  54. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js +1 -1
  55. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  56. package/vscode/src/vs/editor/contrib/find/browser/findController.js +16 -16
  57. package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +27 -27
  58. package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  59. package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +2 -2
  60. package/vscode/src/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  61. package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  62. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  63. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  64. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  65. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  66. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  67. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  68. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  69. package/vscode/src/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  70. package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +2 -2
  71. package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +23 -23
  72. package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
  73. package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
  74. package/vscode/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  75. package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  76. package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  77. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +14 -14
  78. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
  79. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  80. package/vscode/src/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  81. package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +30 -30
  82. package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  83. package/vscode/src/vs/editor/contrib/links/browser/links.js +10 -10
  84. package/vscode/src/vs/editor/contrib/message/browser/messageController.js +1 -1
  85. package/vscode/src/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  86. package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  87. package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  88. package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +17 -17
  89. package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  90. package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +5 -5
  91. package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  92. package/vscode/src/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  93. package/vscode/src/vs/editor/contrib/rename/browser/rename.js +11 -11
  94. package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +6 -6
  95. package/vscode/src/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  96. package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  97. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  98. package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +8 -8
  99. package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
  100. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +16 -16
  101. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  102. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  103. package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  104. package/vscode/src/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  105. package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  106. package/vscode/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  107. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  108. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  109. package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
  110. package/vscode/src/vs/platform/action/common/actionCommonCategories.js +6 -6
  111. package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  112. package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -2
  113. package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
  114. package/vscode/src/vs/platform/actions/common/menuService.js +2 -2
  115. package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  116. package/vscode/src/vs/platform/contextkey/common/contextkey.js +11 -11
  117. package/vscode/src/vs/platform/contextkey/common/contextkeys.js +9 -9
  118. package/vscode/src/vs/platform/dialogs/common/dialogs.js +9 -9
  119. package/vscode/src/vs/platform/dnd/browser/dnd.js +1 -1
  120. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -2
  121. package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
  122. package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +7 -11
  123. package/vscode/src/vs/platform/extensions/common/extensionValidator.js +20 -20
  124. package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js +2 -2
  125. package/vscode/src/vs/platform/files/common/files.js +6 -6
  126. package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  127. package/vscode/src/vs/platform/list/browser/listService.js +27 -27
  128. package/vscode/src/vs/platform/log/common/log.js +6 -6
  129. package/vscode/src/vs/platform/markers/common/markers.js +3 -3
  130. package/vscode/src/vs/platform/quickinput/browser/quickInput.js +8 -8
  131. package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +6 -6
  132. package/vscode/src/vs/platform/request/common/request.js +14 -14
  133. package/vscode/src/vs/platform/theme/common/iconRegistry.js +5 -5
  134. package/vscode/src/vs/platform/theme/common/tokenClassificationRegistry.js +42 -42
  135. package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  136. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +5 -5
  137. package/vscode/src/vs/platform/workspace/common/workspace.js +1 -1
  138. package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +1 -1
  139. package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +2 -2
  140. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +2 -2
  141. package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +1 -1
  142. package/vscode/src/vs/workbench/api/common/extHostLogService.js +1 -1
  143. package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
  144. package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +2 -2
  145. package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +1 -1
  146. package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +1 -1
  147. package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +2 -2
  148. package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +1 -1
  149. package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +12 -12
  150. package/vscode/src/vs/workbench/browser/actions/developerActions.js +31 -31
  151. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +129 -129
  152. package/vscode/src/vs/workbench/browser/actions/textInputActions.js +6 -6
  153. package/vscode/src/vs/workbench/browser/actions/windowActions.js +25 -25
  154. package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +21 -21
  155. package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +4 -4
  156. package/vscode/src/vs/workbench/browser/editor.js +2 -2
  157. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbs.js +41 -41
  158. package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +16 -16
  159. package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +2 -2
  160. package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -1
  161. package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +15 -15
  162. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +17 -17
  163. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +3 -3
  164. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +6 -6
  165. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +9 -9
  166. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +6 -6
  167. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +13 -13
  168. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +2 -2
  169. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +4 -4
  170. package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +34 -34
  171. package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +18 -18
  172. package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +2 -2
  173. package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +1 -1
  174. package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +4 -4
  175. package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +6 -6
  176. package/vscode/src/vs/workbench/browser/quickaccess.js +1 -1
  177. package/vscode/src/vs/workbench/browser/workbench.contribution.js +217 -217
  178. package/vscode/src/vs/workbench/common/configuration.js +10 -10
  179. package/vscode/src/vs/workbench/common/contextkeys.js +70 -70
  180. package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +1 -1
  181. package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +1 -1
  182. package/vscode/src/vs/workbench/common/editor/textEditorModel.js +1 -1
  183. package/vscode/src/vs/workbench/common/views.js +4 -4
  184. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +131 -131
  185. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +17 -18
  186. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +5 -0
  187. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +7 -6
  188. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +8 -7
  189. package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +1 -1
  190. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.js +9 -9
  191. package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +2 -2
  192. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.js +8 -8
  193. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.js +1 -1
  194. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +1 -1
  195. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +2 -2
  196. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +8 -8
  197. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +2 -2
  198. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInvocationPart.js +1 -1
  199. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +1 -1
  200. package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.js +3 -3
  201. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditingService.js +13 -12
  202. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +2 -2
  203. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +1 -1
  204. package/vscode/src/vs/workbench/contrib/chat/browser/chatImagePaste.js +1 -1
  205. package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.js +5 -5
  206. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +12 -12
  207. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +12 -12
  208. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +3 -4
  209. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +15 -15
  210. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +4 -3
  211. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.js +2 -0
  212. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +1 -1
  213. package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +6 -6
  214. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +21 -21
  215. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +3 -3
  216. package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +15 -15
  217. package/vscode/src/vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint.js +10 -10
  218. package/vscode/src/vs/workbench/contrib/codeActions/common/documentationExtensionPoint.js +6 -6
  219. package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
  220. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +5 -5
  221. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -3
  222. package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +3 -3
  223. package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +6 -6
  224. package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +4 -4
  225. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
  226. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +4 -4
  227. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
  228. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +2 -2
  229. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +5 -5
  230. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +4 -4
  231. package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
  232. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +5 -5
  233. package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +1 -1
  234. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +9 -9
  235. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +13 -13
  236. package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +10 -10
  237. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +29 -29
  238. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +65 -65
  239. package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +2 -2
  240. package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +12 -12
  241. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +34 -34
  242. package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +57 -57
  243. package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
  244. package/vscode/src/vs/workbench/contrib/debug/common/debug.js +63 -63
  245. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +6 -6
  246. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +1 -1
  247. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +2 -2
  248. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +173 -173
  249. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +24 -24
  250. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +5 -5
  251. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +2 -2
  252. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +3 -3
  253. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +18 -18
  254. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +14 -14
  255. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +84 -84
  256. package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
  257. package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +33 -33
  258. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +52 -52
  259. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
  260. package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
  261. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +8 -8
  262. package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +7 -7
  263. package/vscode/src/vs/workbench/contrib/files/common/files.js +14 -14
  264. package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +3 -3
  265. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +20 -20
  266. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +4 -4
  267. package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
  268. package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +4 -4
  269. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +19 -19
  270. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +6 -6
  271. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
  272. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +41 -41
  273. package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
  274. package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
  275. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +1 -1
  276. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +29 -29
  277. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +8 -8
  278. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +2 -2
  279. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +1 -1
  280. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +6 -6
  281. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +3 -3
  282. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
  283. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +3 -3
  284. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +5 -5
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +2 -2
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +3 -3
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +4 -4
  289. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
  290. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
  291. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +3 -3
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +4 -4
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +8 -8
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +24 -24
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +28 -28
  297. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +4 -4
  298. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +4 -4
  299. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +1 -1
  300. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +15 -15
  301. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +2 -2
  302. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -2
  303. package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesIcons.js +12 -12
  304. package/vscode/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.js +2 -2
  305. package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +23 -23
  306. package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +13 -13
  307. package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +5 -1
  308. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +10 -10
  309. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +1 -1
  310. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +2 -2
  311. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
  312. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
  313. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
  314. package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
  315. package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +5 -5
  316. package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +5 -5
  317. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +3 -3
  318. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +4 -4
  319. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +7 -7
  320. package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +16 -16
  321. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.js +5 -0
  322. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
  323. package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +6 -6
  324. package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +3 -3
  325. package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +2 -2
  326. package/vscode/src/vs/workbench/services/activity/common/activity.js +4 -4
  327. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +5 -5
  328. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +15 -15
  329. package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +1 -1
  330. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.js +1 -1
  331. package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +6 -6
  332. package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +5 -5
  333. package/vscode/src/vs/workbench/services/language/common/languageService.js +28 -28
  334. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +2 -2
  335. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +7 -7
  336. package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +2 -2
  337. package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +1 -1
  338. package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +9 -9
  339. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +3 -3
  340. package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +22 -22
  341. package/vscode/src/vs/workbench/services/themes/common/colorThemeData.js +8 -8
  342. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +13 -13
  343. package/vscode/src/vs/workbench/services/views/browser/viewsService.js +7 -7
  344. package/vscode/src/vs/base/common/processes.js +0 -25
  345. package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +0 -41
  346. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.js +0 -345
  347. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.js +0 -296
  348. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +0 -761
  349. package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +0 -29
  350. package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +0 -22
  351. package/vscode/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +0 -48
  352. package/vscode/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +0 -94
  353. package/vscode/src/vs/platform/terminal/common/environmentVariable.js +0 -7
  354. package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +0 -196
  355. package/vscode/src/vs/platform/terminal/common/terminalEnvironment.js +0 -40
  356. package/vscode/src/vs/platform/terminal/common/terminalProfiles.js +0 -107
  357. package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +0 -67
  358. package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +0 -346
  359. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +0 -167
  360. package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +0 -119
  361. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +0 -1770
  362. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +0 -40
  363. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +0 -25
  364. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.js +0 -72
  365. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +0 -16
  366. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +0 -2218
  367. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +0 -628
  368. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +0 -143
  369. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +0 -61
  370. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +0 -315
  371. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +0 -121
  372. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalUri.js +0 -39
  373. package/vscode/src/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +0 -36
  374. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +0 -498
  375. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +0 -123
  376. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +0 -55
  377. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +0 -571
  378. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +0 -732
  379. package/vscode/src/vs/workbench/contrib/terminal/common/history.js +0 -378
  380. package/vscode/src/vs/workbench/contrib/terminal/common/terminalClipboard.js +0 -80
  381. package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +0 -282
  382. package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +0 -36
  383. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css.js +0 -4
  384. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +0 -46
  385. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +0 -303
  386. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +0 -203
  387. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css.js +0 -4
  388. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +0 -22
  389. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.js +0 -97
  390. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +0 -372
@@ -1,2218 +0,0 @@
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 };