@codingame/monaco-vscode-xterm-common 25.1.2 → 26.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +2 -2
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +20 -16
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +20 -11
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +15 -21
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +386 -301
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +11 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.js +4 -8
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +792 -548
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +225 -128
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +14 -5
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +23 -19
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +174 -126
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +29 -22
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +3 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +112 -114
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +16 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.js +33 -23
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +115 -84
|
@@ -23,7 +23,7 @@ import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/
|
|
|
23
23
|
import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
24
24
|
|
|
25
25
|
var TerminalStatus;
|
|
26
|
-
(function
|
|
26
|
+
(function(TerminalStatus) {
|
|
27
27
|
TerminalStatus["Bell"] = "bell";
|
|
28
28
|
TerminalStatus["Disconnected"] = "disconnected";
|
|
29
29
|
TerminalStatus["RelaunchNeeded"] = "relaunch-needed";
|
|
@@ -32,9 +32,15 @@ var TerminalStatus;
|
|
|
32
32
|
TerminalStatus["ShellIntegrationAttentionNeeded"] = "shell-integration-attention-needed";
|
|
33
33
|
})(TerminalStatus || (TerminalStatus = {}));
|
|
34
34
|
let TerminalStatusList = class TerminalStatusList extends Disposable {
|
|
35
|
-
get onDidAddStatus() {
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
get onDidAddStatus() {
|
|
36
|
+
return this._onDidAddStatus.event;
|
|
37
|
+
}
|
|
38
|
+
get onDidRemoveStatus() {
|
|
39
|
+
return this._onDidRemoveStatus.event;
|
|
40
|
+
}
|
|
41
|
+
get onDidChangePrimaryStatus() {
|
|
42
|
+
return this._onDidChangePrimaryStatus.event;
|
|
43
|
+
}
|
|
38
44
|
constructor(_configurationService) {
|
|
39
45
|
super();
|
|
40
46
|
this._configurationService = _configurationService;
|
|
@@ -55,7 +61,9 @@ let TerminalStatusList = class TerminalStatusList extends Disposable {
|
|
|
55
61
|
}
|
|
56
62
|
return result;
|
|
57
63
|
}
|
|
58
|
-
get statuses() {
|
|
64
|
+
get statuses() {
|
|
65
|
+
return Array.from(( this._statuses.values()));
|
|
66
|
+
}
|
|
59
67
|
add(status, duration) {
|
|
60
68
|
status = this._applyAnimationSetting(status);
|
|
61
69
|
const outTimeout = this._statusTimeouts.get(status.id);
|
|
@@ -96,20 +104,18 @@ let TerminalStatusList = class TerminalStatusList extends Disposable {
|
|
|
96
104
|
toggle(status, value) {
|
|
97
105
|
if (value) {
|
|
98
106
|
this.add(status);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
107
|
+
} else {
|
|
101
108
|
this.remove(status);
|
|
102
109
|
}
|
|
103
110
|
}
|
|
104
111
|
_applyAnimationSetting(status) {
|
|
105
|
-
if (!status.icon || ThemeIcon.getModifier(status.icon) !==
|
|
112
|
+
if (!status.icon || ThemeIcon.getModifier(status.icon) !== "spin" || this._configurationService.getValue(TerminalSettingId.TabsEnableAnimation)) {
|
|
106
113
|
return status;
|
|
107
114
|
}
|
|
108
115
|
let icon;
|
|
109
116
|
if (status.icon.id === spinningLoading.id) {
|
|
110
117
|
icon = Codicon.play;
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
118
|
+
} else {
|
|
113
119
|
icon = ThemeIcon.modify(status.icon, undefined);
|
|
114
120
|
}
|
|
115
121
|
return {
|
|
@@ -118,17 +124,15 @@ let TerminalStatusList = class TerminalStatusList extends Disposable {
|
|
|
118
124
|
};
|
|
119
125
|
}
|
|
120
126
|
};
|
|
121
|
-
TerminalStatusList = ( __decorate([
|
|
122
|
-
( __param(0, IConfigurationService))
|
|
123
|
-
], TerminalStatusList));
|
|
127
|
+
TerminalStatusList = ( __decorate([( __param(0, IConfigurationService))], TerminalStatusList));
|
|
124
128
|
function getColorForSeverity(severity) {
|
|
125
129
|
switch (severity) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
case Severity.Error:
|
|
131
|
+
return listErrorForeground;
|
|
132
|
+
case Severity.Warning:
|
|
133
|
+
return listWarningForeground;
|
|
134
|
+
default:
|
|
135
|
+
return "";
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
138
|
|
|
@@ -54,7 +54,7 @@ import { isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/typ
|
|
|
54
54
|
|
|
55
55
|
const $ = $$1;
|
|
56
56
|
var TerminalTabsListSizes;
|
|
57
|
-
(function
|
|
57
|
+
(function(TerminalTabsListSizes) {
|
|
58
58
|
TerminalTabsListSizes[TerminalTabsListSizes["TabHeight"] = 22] = "TabHeight";
|
|
59
59
|
TerminalTabsListSizes[TerminalTabsListSizes["NarrowViewWidth"] = 46] = "NarrowViewWidth";
|
|
60
60
|
TerminalTabsListSizes[TerminalTabsListSizes["WideViewMinimumWidth"] = 80] = "WideViewMinimumWidth";
|
|
@@ -64,13 +64,38 @@ var TerminalTabsListSizes;
|
|
|
64
64
|
TerminalTabsListSizes[TerminalTabsListSizes["MaximumWidth"] = 500] = "MaximumWidth";
|
|
65
65
|
})(TerminalTabsListSizes || (TerminalTabsListSizes = {}));
|
|
66
66
|
let TerminalTabList = class TerminalTabList extends WorkbenchList {
|
|
67
|
-
get hasText() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
get hasText() {
|
|
68
|
+
return this._hasText;
|
|
69
|
+
}
|
|
70
|
+
get hasActionBar() {
|
|
71
|
+
return this._hasActionBar;
|
|
72
|
+
}
|
|
73
|
+
constructor(
|
|
74
|
+
container,
|
|
75
|
+
contextKeyService,
|
|
76
|
+
listService,
|
|
77
|
+
_configurationService,
|
|
78
|
+
_terminalService,
|
|
79
|
+
_terminalGroupService,
|
|
80
|
+
_terminalEditingService,
|
|
81
|
+
instantiationService,
|
|
82
|
+
decorationsService,
|
|
83
|
+
_themeService,
|
|
84
|
+
_storageService,
|
|
85
|
+
lifecycleService,
|
|
86
|
+
_hoverService
|
|
87
|
+
) {
|
|
88
|
+
super("TerminalTabsList", container, {
|
|
71
89
|
getHeight: () => TerminalTabsListSizes.TabHeight,
|
|
72
|
-
getTemplateId: () =>
|
|
73
|
-
}, [instantiationService.createInstance(
|
|
90
|
+
getTemplateId: () => "terminal.tabs"
|
|
91
|
+
}, [instantiationService.createInstance(
|
|
92
|
+
TerminalTabsRenderer,
|
|
93
|
+
container,
|
|
94
|
+
instantiationService.createInstance(ResourceLabels, DEFAULT_LABELS_CONTAINER),
|
|
95
|
+
() => this.getSelectedElements(),
|
|
96
|
+
() => this.hasText,
|
|
97
|
+
() => this.hasActionBar
|
|
98
|
+
)], {
|
|
74
99
|
horizontalScrolling: false,
|
|
75
100
|
supportDynamicHeights: false,
|
|
76
101
|
selectionNavigation: true,
|
|
@@ -78,7 +103,7 @@ let TerminalTabList = class TerminalTabList extends WorkbenchList {
|
|
|
78
103
|
getId: e => e?.instanceId
|
|
79
104
|
},
|
|
80
105
|
accessibilityProvider: instantiationService.createInstance(TerminalTabsAccessibilityProvider),
|
|
81
|
-
smoothScrolling: _configurationService.getValue(
|
|
106
|
+
smoothScrolling: _configurationService.getValue("workbench.list.smoothScrolling"),
|
|
82
107
|
multipleSelectionSupport: true,
|
|
83
108
|
paddingBottom: TerminalTabsListSizes.TabHeight,
|
|
84
109
|
dnd: instantiationService.createInstance(TerminalTabsDragAndDrop),
|
|
@@ -111,7 +136,11 @@ let TerminalTabList = class TerminalTabList extends WorkbenchList {
|
|
|
111
136
|
}
|
|
112
137
|
this.refresh();
|
|
113
138
|
}),
|
|
114
|
-
this._storageService.onDidChangeValue(
|
|
139
|
+
this._storageService.onDidChangeValue(
|
|
140
|
+
StorageScope.APPLICATION,
|
|
141
|
+
TerminalStorageKeys.TabsShowDetailed,
|
|
142
|
+
this.disposables
|
|
143
|
+
)(() => this.refresh())
|
|
115
144
|
];
|
|
116
145
|
this.disposables.add(lifecycleService.onWillShutdown(e => {
|
|
117
146
|
dispose(instanceDisposables);
|
|
@@ -121,11 +150,13 @@ let TerminalTabList = class TerminalTabList extends WorkbenchList {
|
|
|
121
150
|
dispose(instanceDisposables);
|
|
122
151
|
instanceDisposables.length = 0;
|
|
123
152
|
}));
|
|
124
|
-
this.disposables.add(this.onMouseDblClick(async
|
|
153
|
+
this.disposables.add(this.onMouseDblClick(async e => {
|
|
125
154
|
if (!e.element) {
|
|
126
155
|
e.browserEvent.preventDefault();
|
|
127
156
|
e.browserEvent.stopPropagation();
|
|
128
|
-
const instance = await this._terminalService.createTerminal({
|
|
157
|
+
const instance = await this._terminalService.createTerminal({
|
|
158
|
+
location: TerminalLocation.Panel
|
|
159
|
+
});
|
|
129
160
|
this._terminalGroupService.setActiveInstance(instance);
|
|
130
161
|
await instance.focusWhenReady();
|
|
131
162
|
return;
|
|
@@ -133,18 +164,21 @@ let TerminalTabList = class TerminalTabList extends WorkbenchList {
|
|
|
133
164
|
if (this._terminalEditingService.getEditingTerminal()?.instanceId === e.element.instanceId) {
|
|
134
165
|
return;
|
|
135
166
|
}
|
|
136
|
-
if (this._getFocusMode() ===
|
|
167
|
+
if (this._getFocusMode() === "doubleClick" && this.getFocus().length === 1) {
|
|
137
168
|
e.element.focus(true);
|
|
138
169
|
}
|
|
139
170
|
}));
|
|
140
|
-
this.disposables.add(this.onMouseClick(async
|
|
171
|
+
this.disposables.add(this.onMouseClick(async e => {
|
|
141
172
|
if (this._terminalEditingService.getEditingTerminal()?.instanceId === e.element?.instanceId) {
|
|
142
173
|
return;
|
|
143
174
|
}
|
|
144
175
|
if (e.browserEvent.altKey && e.element) {
|
|
145
|
-
await this._terminalService.createTerminal({
|
|
146
|
-
|
|
147
|
-
|
|
176
|
+
await this._terminalService.createTerminal({
|
|
177
|
+
location: {
|
|
178
|
+
parentTerminal: e.element
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
} else if (this._getFocusMode() === "singleClick") {
|
|
148
182
|
if (this.getSelection().length <= 1) {
|
|
149
183
|
e.element?.focus(true);
|
|
150
184
|
}
|
|
@@ -164,7 +198,7 @@ let TerminalTabList = class TerminalTabList extends WorkbenchList {
|
|
|
164
198
|
this._isSplitContextKey = TerminalContextKeys.splitTerminalTabFocused.bindTo(contextKeyService);
|
|
165
199
|
this.disposables.add(this.onDidChangeSelection(e => this._updateContextKey()));
|
|
166
200
|
this.disposables.add(this.onDidChangeFocus(() => this._updateContextKey()));
|
|
167
|
-
this.disposables.add(this.onDidOpen(async
|
|
201
|
+
this.disposables.add(this.onDidOpen(async e => {
|
|
168
202
|
const instance = e.element;
|
|
169
203
|
if (!instance) {
|
|
170
204
|
return;
|
|
@@ -203,7 +237,9 @@ let TerminalTabList = class TerminalTabList extends WorkbenchList {
|
|
|
203
237
|
_updateContextKey() {
|
|
204
238
|
this._terminalTabsSingleSelectedContextKey.set(this.getSelectedElements().length === 1);
|
|
205
239
|
const instance = this.getFocusedElements();
|
|
206
|
-
this._isSplitContextKey.set(
|
|
240
|
+
this._isSplitContextKey.set(
|
|
241
|
+
instance.length > 0 && this._terminalGroupService.instanceIsSplit(instance[0])
|
|
242
|
+
);
|
|
207
243
|
}
|
|
208
244
|
layout(height, width) {
|
|
209
245
|
super.layout(height, width);
|
|
@@ -217,22 +253,27 @@ let TerminalTabList = class TerminalTabList extends WorkbenchList {
|
|
|
217
253
|
}
|
|
218
254
|
}
|
|
219
255
|
};
|
|
220
|
-
TerminalTabList = ( __decorate([
|
|
221
|
-
( __param(1, IContextKeyService)),
|
|
222
|
-
( __param(2, IListService)),
|
|
223
|
-
( __param(3, IConfigurationService)),
|
|
224
|
-
( __param(4, ITerminalService)),
|
|
225
|
-
( __param(5, ITerminalGroupService)),
|
|
226
|
-
( __param(6, ITerminalEditingService)),
|
|
227
|
-
( __param(7, IInstantiationService)),
|
|
228
|
-
( __param(8, IDecorationsService)),
|
|
229
|
-
( __param(9, IThemeService)),
|
|
230
|
-
( __param(10, IStorageService)),
|
|
231
|
-
( __param(11, ILifecycleService)),
|
|
232
|
-
( __param(12, IHoverService))
|
|
233
|
-
], TerminalTabList));
|
|
256
|
+
TerminalTabList = ( __decorate([( __param(1, IContextKeyService)), ( __param(2, IListService)), ( __param(3, IConfigurationService)), ( __param(4, ITerminalService)), ( __param(5, ITerminalGroupService)), ( __param(6, ITerminalEditingService)), ( __param(7, IInstantiationService)), ( __param(8, IDecorationsService)), ( __param(9, IThemeService)), ( __param(10, IStorageService)), ( __param(11, ILifecycleService)), ( __param(12, IHoverService))], TerminalTabList));
|
|
234
257
|
let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
235
|
-
constructor(
|
|
258
|
+
constructor(
|
|
259
|
+
_container,
|
|
260
|
+
_labels,
|
|
261
|
+
_getSelection,
|
|
262
|
+
_getHasText,
|
|
263
|
+
_getHasActionBar,
|
|
264
|
+
_instantiationService,
|
|
265
|
+
_terminalConfigurationService,
|
|
266
|
+
_terminalService,
|
|
267
|
+
_terminalGroupService,
|
|
268
|
+
_terminalEditingService,
|
|
269
|
+
_hoverService,
|
|
270
|
+
_keybindingService,
|
|
271
|
+
_listService,
|
|
272
|
+
_storageService,
|
|
273
|
+
_themeService,
|
|
274
|
+
_contextViewService,
|
|
275
|
+
_commandService
|
|
276
|
+
) {
|
|
236
277
|
this._labels = _labels;
|
|
237
278
|
this._getSelection = _getSelection;
|
|
238
279
|
this._getHasText = _getHasText;
|
|
@@ -249,10 +290,10 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
249
290
|
this._themeService = _themeService;
|
|
250
291
|
this._contextViewService = _contextViewService;
|
|
251
292
|
this._commandService = _commandService;
|
|
252
|
-
this.templateId =
|
|
293
|
+
this.templateId = "terminal.tabs";
|
|
253
294
|
}
|
|
254
295
|
renderTemplate(container) {
|
|
255
|
-
const element = append(container, $(
|
|
296
|
+
const element = append(container, $(".terminal-tabs-entry"));
|
|
256
297
|
const context = {};
|
|
257
298
|
const templateDisposables = ( new DisposableStore());
|
|
258
299
|
const label = templateDisposables.add(this._labels.create(element, {
|
|
@@ -270,18 +311,22 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
270
311
|
showPointer: true
|
|
271
312
|
},
|
|
272
313
|
position: {
|
|
273
|
-
hoverPosition: this._terminalConfigurationService.config.tabs.location ===
|
|
314
|
+
hoverPosition: this._terminalConfigurationService.config.tabs.location === "left" ? HoverPosition.RIGHT : HoverPosition.LEFT
|
|
274
315
|
}
|
|
275
|
-
}, {
|
|
316
|
+
}, {
|
|
317
|
+
groupId: "terminal-tabs-list"
|
|
318
|
+
});
|
|
276
319
|
}
|
|
277
320
|
}
|
|
278
321
|
}));
|
|
279
|
-
const actionsContainer = append(label.element, $(
|
|
322
|
+
const actionsContainer = append(label.element, $(".actions"));
|
|
280
323
|
const actionBar = templateDisposables.add(( new ActionBar(actionsContainer, {
|
|
281
324
|
actionRunner: templateDisposables.add(( new TerminalContextActionRunner())),
|
|
282
|
-
actionViewItemProvider: (action, options) => action instanceof MenuItemAction
|
|
283
|
-
|
|
284
|
-
|
|
325
|
+
actionViewItemProvider: (action, options) => action instanceof MenuItemAction ? templateDisposables.add(
|
|
326
|
+
this._instantiationService.createInstance(MenuEntryActionViewItem, action, {
|
|
327
|
+
hoverDelegate: options.hoverDelegate
|
|
328
|
+
})
|
|
329
|
+
) : undefined
|
|
285
330
|
})));
|
|
286
331
|
return {
|
|
287
332
|
element,
|
|
@@ -299,35 +344,31 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
299
344
|
if (!group) {
|
|
300
345
|
throw ( new Error(`Could not find group for instance "${instance.instanceId}"`));
|
|
301
346
|
}
|
|
302
|
-
template.element.classList.toggle(
|
|
303
|
-
template.element.classList.toggle(
|
|
304
|
-
let prefix =
|
|
347
|
+
template.element.classList.toggle("has-text", hasText);
|
|
348
|
+
template.element.classList.toggle("is-active", this._terminalGroupService.activeInstance === instance);
|
|
349
|
+
let prefix = "";
|
|
305
350
|
if (group.terminalInstances.length > 1) {
|
|
306
351
|
const terminalIndex = group.terminalInstances.indexOf(instance);
|
|
307
352
|
if (terminalIndex === 0) {
|
|
308
353
|
prefix = `┌ `;
|
|
309
|
-
}
|
|
310
|
-
else if (terminalIndex === group.terminalInstances.length - 1) {
|
|
354
|
+
} else if (terminalIndex === group.terminalInstances.length - 1) {
|
|
311
355
|
prefix = `└ `;
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
356
|
+
} else {
|
|
314
357
|
prefix = `├ `;
|
|
315
358
|
}
|
|
316
359
|
}
|
|
317
360
|
const hoverInfo = getInstanceHoverInfo(instance, this._storageService);
|
|
318
361
|
template.context.hoverActions = hoverInfo.actions;
|
|
319
362
|
const iconId = this._instantiationService.invokeFunction(getIconId, instance);
|
|
320
|
-
let label =
|
|
363
|
+
let label = "";
|
|
321
364
|
if (!hasText) {
|
|
322
365
|
const primaryStatus = instance.statusList.primary;
|
|
323
366
|
if (primaryStatus && primaryStatus.severity > Severity.Ignore) {
|
|
324
367
|
label = `${prefix}$(${primaryStatus.icon?.id || iconId})`;
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
368
|
+
} else {
|
|
327
369
|
label = `${prefix}$(${iconId})`;
|
|
328
370
|
}
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
371
|
+
} else {
|
|
331
372
|
this.fillActionBar(instance, template);
|
|
332
373
|
label = prefix;
|
|
333
374
|
if (instance.icon) {
|
|
@@ -368,17 +409,21 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
368
409
|
extraClasses
|
|
369
410
|
});
|
|
370
411
|
const editableData = this._terminalEditingService.getEditableData(instance);
|
|
371
|
-
template.label.element.classList.toggle(
|
|
412
|
+
template.label.element.classList.toggle("editable-tab", !!editableData);
|
|
372
413
|
if (editableData) {
|
|
373
|
-
template.elementDisposables.add(this._renderInputBox(
|
|
414
|
+
template.elementDisposables.add(this._renderInputBox(
|
|
415
|
+
template.label.element.querySelector(".monaco-icon-label-container"),
|
|
416
|
+
instance,
|
|
417
|
+
editableData
|
|
418
|
+
));
|
|
374
419
|
template.actionBar.clear();
|
|
375
420
|
}
|
|
376
421
|
}
|
|
377
422
|
_renderInputBox(container, instance, editableData) {
|
|
378
|
-
const value = instance.title ||
|
|
423
|
+
const value = instance.title || "";
|
|
379
424
|
const inputBox = ( new InputBox(container, this._contextViewService, {
|
|
380
425
|
validationOptions: {
|
|
381
|
-
validation:
|
|
426
|
+
validation: value => {
|
|
382
427
|
const message = editableData.validationMessage(value);
|
|
383
428
|
if (!message || message.severity !== Severity.Error) {
|
|
384
429
|
return null;
|
|
@@ -390,15 +435,18 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
390
435
|
};
|
|
391
436
|
}
|
|
392
437
|
},
|
|
393
|
-
ariaLabel: ( localize(
|
|
438
|
+
ariaLabel: ( localize(11990, "Type terminal name. Press Enter to confirm or Escape to cancel.")),
|
|
394
439
|
inputBoxStyles: defaultInputBoxStyles
|
|
395
440
|
}));
|
|
396
|
-
inputBox.element.style.height =
|
|
441
|
+
inputBox.element.style.height = "22px";
|
|
397
442
|
inputBox.value = value;
|
|
398
443
|
inputBox.focus();
|
|
399
|
-
inputBox.select({
|
|
444
|
+
inputBox.select({
|
|
445
|
+
start: 0,
|
|
446
|
+
end: value.length
|
|
447
|
+
});
|
|
400
448
|
const done = createSingleCallFunction((success, finishEditing) => {
|
|
401
|
-
inputBox.element.style.display =
|
|
449
|
+
inputBox.element.style.display = "none";
|
|
402
450
|
const value = inputBox.value;
|
|
403
451
|
dispose(toDispose);
|
|
404
452
|
inputBox.element.remove();
|
|
@@ -415,8 +463,7 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
415
463
|
formatContent: true,
|
|
416
464
|
type: message.severity === Severity.Info ? MessageType.INFO : message.severity === Severity.Warning ? MessageType.WARNING : MessageType.ERROR
|
|
417
465
|
});
|
|
418
|
-
}
|
|
419
|
-
else {
|
|
466
|
+
} else {
|
|
420
467
|
inputBox.hideMessage();
|
|
421
468
|
}
|
|
422
469
|
}
|
|
@@ -424,16 +471,15 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
424
471
|
showInputBoxNotification();
|
|
425
472
|
const toDispose = [
|
|
426
473
|
inputBox,
|
|
427
|
-
addStandardDisposableListener(inputBox.inputElement, EventType.KEY_DOWN,
|
|
474
|
+
addStandardDisposableListener(inputBox.inputElement, EventType.KEY_DOWN, e => {
|
|
428
475
|
e.stopPropagation();
|
|
429
476
|
if (e.equals(KeyCode.Enter)) {
|
|
430
477
|
done(inputBox.isInputValid(), true);
|
|
431
|
-
}
|
|
432
|
-
else if (e.equals(KeyCode.Escape)) {
|
|
478
|
+
} else if (e.equals(KeyCode.Escape)) {
|
|
433
479
|
done(false, true);
|
|
434
480
|
}
|
|
435
481
|
}),
|
|
436
|
-
addStandardDisposableListener(inputBox.inputElement, EventType.KEY_UP,
|
|
482
|
+
addStandardDisposableListener(inputBox.inputElement, EventType.KEY_UP, e => {
|
|
437
483
|
showInputBoxNotification();
|
|
438
484
|
}),
|
|
439
485
|
addDisposableListener(inputBox.inputElement, EventType.BLUR, () => {
|
|
@@ -453,19 +499,21 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
453
499
|
templateData.templateDisposables.dispose();
|
|
454
500
|
}
|
|
455
501
|
fillActionBar(instance, template) {
|
|
456
|
-
const actions = [
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
async
|
|
463
|
-
this.
|
|
464
|
-
|
|
502
|
+
const actions = [template.elementDisposables.add(( new Action(
|
|
503
|
+
TerminalCommandId.SplitActiveTab,
|
|
504
|
+
terminalStrings.split.short,
|
|
505
|
+
ThemeIcon.asClassName(Codicon.splitHorizontal),
|
|
506
|
+
true,
|
|
507
|
+
async () => {
|
|
508
|
+
this._runForSelectionOrInstance(instance, async e => {
|
|
509
|
+
this._terminalService.createTerminal({
|
|
510
|
+
location: {
|
|
511
|
+
parentTerminal: e
|
|
512
|
+
}
|
|
465
513
|
});
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
];
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
)))];
|
|
469
517
|
if (instance.shellLaunchConfig.tabActions) {
|
|
470
518
|
for (const action of instance.shellLaunchConfig.tabActions) {
|
|
471
519
|
actions.push(template.elementDisposables.add(( new Action(
|
|
@@ -490,7 +538,11 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
490
538
|
))));
|
|
491
539
|
template.actionBar.clear();
|
|
492
540
|
for (const action of actions) {
|
|
493
|
-
template.actionBar.push(action, {
|
|
541
|
+
template.actionBar.push(action, {
|
|
542
|
+
icon: true,
|
|
543
|
+
label: false,
|
|
544
|
+
keybinding: this._keybindingService.lookupKeybinding(action.id)?.getLabel()
|
|
545
|
+
});
|
|
494
546
|
}
|
|
495
547
|
}
|
|
496
548
|
_runForSelectionOrInstance(instance, callback) {
|
|
@@ -501,60 +553,48 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
501
553
|
callback(s);
|
|
502
554
|
}
|
|
503
555
|
}
|
|
504
|
-
}
|
|
505
|
-
else {
|
|
556
|
+
} else {
|
|
506
557
|
callback(instance);
|
|
507
558
|
}
|
|
508
559
|
this._terminalGroupService.focusTabs();
|
|
509
560
|
this._listService.lastFocusedList?.focusNext();
|
|
510
561
|
}
|
|
511
562
|
};
|
|
512
|
-
TerminalTabsRenderer = ( __decorate([
|
|
513
|
-
( __param(5, IInstantiationService)),
|
|
514
|
-
( __param(6, ITerminalConfigurationService)),
|
|
515
|
-
( __param(7, ITerminalService)),
|
|
516
|
-
( __param(8, ITerminalGroupService)),
|
|
517
|
-
( __param(9, ITerminalEditingService)),
|
|
518
|
-
( __param(10, IHoverService)),
|
|
519
|
-
( __param(11, IKeybindingService)),
|
|
520
|
-
( __param(12, IListService)),
|
|
521
|
-
( __param(13, IStorageService)),
|
|
522
|
-
( __param(14, IThemeService)),
|
|
523
|
-
( __param(15, IContextViewService)),
|
|
524
|
-
( __param(16, ICommandService))
|
|
525
|
-
], TerminalTabsRenderer));
|
|
563
|
+
TerminalTabsRenderer = ( __decorate([( __param(5, IInstantiationService)), ( __param(6, ITerminalConfigurationService)), ( __param(7, ITerminalService)), ( __param(8, ITerminalGroupService)), ( __param(9, ITerminalEditingService)), ( __param(10, IHoverService)), ( __param(11, IKeybindingService)), ( __param(12, IListService)), ( __param(13, IStorageService)), ( __param(14, IThemeService)), ( __param(15, IContextViewService)), ( __param(16, ICommandService))], TerminalTabsRenderer));
|
|
526
564
|
let TerminalTabsAccessibilityProvider = class TerminalTabsAccessibilityProvider {
|
|
527
565
|
constructor(_terminalGroupService) {
|
|
528
566
|
this._terminalGroupService = _terminalGroupService;
|
|
529
567
|
}
|
|
530
568
|
getWidgetAriaLabel() {
|
|
531
|
-
return localize(
|
|
569
|
+
return localize(11991, "Terminal tabs");
|
|
532
570
|
}
|
|
533
571
|
getAriaLabel(instance) {
|
|
534
|
-
let ariaLabel =
|
|
572
|
+
let ariaLabel = "";
|
|
535
573
|
const tab = this._terminalGroupService.getGroupForInstance(instance);
|
|
536
574
|
if (tab && tab.terminalInstances?.length > 1) {
|
|
537
575
|
const terminalIndex = tab.terminalInstances.indexOf(instance);
|
|
538
576
|
ariaLabel = ( localize(
|
|
539
|
-
|
|
577
|
+
11992,
|
|
540
578
|
"Terminal {0} {1}, split {2} of {3}",
|
|
541
579
|
instance.instanceId,
|
|
542
580
|
instance.title,
|
|
543
581
|
terminalIndex + 1,
|
|
544
582
|
tab.terminalInstances.length
|
|
545
583
|
));
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
ariaLabel = ( localize(11667, "Terminal {0} {1}", instance.instanceId, instance.title));
|
|
584
|
+
} else {
|
|
585
|
+
ariaLabel = ( localize(11993, "Terminal {0} {1}", instance.instanceId, instance.title));
|
|
549
586
|
}
|
|
550
587
|
return ariaLabel;
|
|
551
588
|
}
|
|
552
589
|
};
|
|
553
|
-
TerminalTabsAccessibilityProvider = ( __decorate([
|
|
554
|
-
( __param(0, ITerminalGroupService))
|
|
555
|
-
], TerminalTabsAccessibilityProvider));
|
|
590
|
+
TerminalTabsAccessibilityProvider = ( __decorate([( __param(0, ITerminalGroupService))], TerminalTabsAccessibilityProvider));
|
|
556
591
|
let TerminalTabsDragAndDrop = class TerminalTabsDragAndDrop extends Disposable {
|
|
557
|
-
constructor(
|
|
592
|
+
constructor(
|
|
593
|
+
_terminalService,
|
|
594
|
+
_terminalGroupService,
|
|
595
|
+
_terminalEditingService,
|
|
596
|
+
_listService
|
|
597
|
+
) {
|
|
558
598
|
super();
|
|
559
599
|
this._terminalService = _terminalService;
|
|
560
600
|
this._terminalGroupService = _terminalGroupService;
|
|
@@ -592,7 +632,13 @@ let TerminalTabsDragAndDrop = class TerminalTabsDragAndDrop extends Disposable {
|
|
|
592
632
|
}
|
|
593
633
|
onDragOver(data, targetInstance, targetIndex, targetSector, originalEvent) {
|
|
594
634
|
if (data instanceof NativeDragAndDropData) {
|
|
595
|
-
if (!containsDragType(
|
|
635
|
+
if (!containsDragType(
|
|
636
|
+
originalEvent,
|
|
637
|
+
DataTransfers.FILES,
|
|
638
|
+
DataTransfers.RESOURCES,
|
|
639
|
+
TerminalDataTransfers.Terminals,
|
|
640
|
+
CodeDataTransfers.FILES
|
|
641
|
+
)) {
|
|
596
642
|
return false;
|
|
597
643
|
}
|
|
598
644
|
}
|
|
@@ -613,7 +659,10 @@ let TerminalTabsDragAndDrop = class TerminalTabsDragAndDrop extends Disposable {
|
|
|
613
659
|
return {
|
|
614
660
|
feedback: targetIndex ? [targetIndex] : undefined,
|
|
615
661
|
accept: true,
|
|
616
|
-
effect: {
|
|
662
|
+
effect: {
|
|
663
|
+
type: ListDragOverEffectType.Move,
|
|
664
|
+
position: ListDragOverEffectPosition.Over
|
|
665
|
+
}
|
|
617
666
|
};
|
|
618
667
|
}
|
|
619
668
|
async drop(data, targetInstance, targetIndex, targetSector, originalEvent) {
|
|
@@ -628,16 +677,16 @@ let TerminalTabsDragAndDrop = class TerminalTabsDragAndDrop extends Disposable {
|
|
|
628
677
|
if (instance) {
|
|
629
678
|
if (Array.isArray(sourceInstances)) {
|
|
630
679
|
sourceInstances.push(instance);
|
|
631
|
-
}
|
|
632
|
-
else {
|
|
680
|
+
} else {
|
|
633
681
|
sourceInstances = [instance];
|
|
634
682
|
}
|
|
635
683
|
this._terminalService.moveToTerminalView(instance);
|
|
636
|
-
}
|
|
637
|
-
else if (this._primaryBackend) {
|
|
684
|
+
} else if (this._primaryBackend) {
|
|
638
685
|
const terminalIdentifier = parseTerminalUri(uri);
|
|
639
686
|
if (terminalIdentifier.instanceId) {
|
|
640
|
-
promises.push(
|
|
687
|
+
promises.push(
|
|
688
|
+
this._primaryBackend.requestDetachInstance(terminalIdentifier.workspaceId, terminalIdentifier.instanceId)
|
|
689
|
+
);
|
|
641
690
|
}
|
|
642
691
|
}
|
|
643
692
|
}
|
|
@@ -647,7 +696,11 @@ let TerminalTabsDragAndDrop = class TerminalTabsDragAndDrop extends Disposable {
|
|
|
647
696
|
processes = processes.filter(p => p !== undefined);
|
|
648
697
|
let lastInstance;
|
|
649
698
|
for (const attachPersistentProcess of processes) {
|
|
650
|
-
lastInstance = await this._terminalService.createTerminal({
|
|
699
|
+
lastInstance = await this._terminalService.createTerminal({
|
|
700
|
+
config: {
|
|
701
|
+
attachPersistentProcess
|
|
702
|
+
}
|
|
703
|
+
});
|
|
651
704
|
}
|
|
652
705
|
if (lastInstance) {
|
|
653
706
|
this._terminalService.setActiveInstance(lastInstance);
|
|
@@ -712,20 +765,17 @@ let TerminalTabsDragAndDrop = class TerminalTabsDragAndDrop extends Disposable {
|
|
|
712
765
|
await instance.sendPath(resource, false);
|
|
713
766
|
}
|
|
714
767
|
};
|
|
715
|
-
TerminalTabsDragAndDrop = ( __decorate([
|
|
716
|
-
( __param(0, ITerminalService)),
|
|
717
|
-
( __param(1, ITerminalGroupService)),
|
|
718
|
-
( __param(2, ITerminalEditingService)),
|
|
719
|
-
( __param(3, IListService))
|
|
720
|
-
], TerminalTabsDragAndDrop));
|
|
768
|
+
TerminalTabsDragAndDrop = ( __decorate([( __param(0, ITerminalService)), ( __param(1, ITerminalGroupService)), ( __param(2, ITerminalEditingService)), ( __param(3, IListService))], TerminalTabsDragAndDrop));
|
|
721
769
|
let TabDecorationsProvider = class TabDecorationsProvider extends Disposable {
|
|
722
770
|
constructor(_terminalService) {
|
|
723
771
|
super();
|
|
724
772
|
this._terminalService = _terminalService;
|
|
725
|
-
this.label = ( localize(
|
|
773
|
+
this.label = ( localize(11994, "Terminal"));
|
|
726
774
|
this._onDidChange = this._register(( new Emitter()));
|
|
727
775
|
this.onDidChange = this._onDidChange.event;
|
|
728
|
-
this._register(
|
|
776
|
+
this._register(
|
|
777
|
+
this._terminalService.onAnyInstancePrimaryStatusChange(e => this._onDidChange.fire([e.resource]))
|
|
778
|
+
);
|
|
729
779
|
}
|
|
730
780
|
provideDecorations(resource) {
|
|
731
781
|
if (resource.scheme !== Schemas.vscodeTerminal) {
|
|
@@ -746,11 +796,9 @@ let TabDecorationsProvider = class TabDecorationsProvider extends Disposable {
|
|
|
746
796
|
};
|
|
747
797
|
}
|
|
748
798
|
};
|
|
749
|
-
TabDecorationsProvider = ( __decorate([
|
|
750
|
-
( __param(0, ITerminalService))
|
|
751
|
-
], TabDecorationsProvider));
|
|
799
|
+
TabDecorationsProvider = ( __decorate([( __param(0, ITerminalService))], TabDecorationsProvider));
|
|
752
800
|
function isTerminalInstance(obj) {
|
|
753
|
-
return isObject(obj) &&
|
|
801
|
+
return isObject(obj) && "instanceId" in obj;
|
|
754
802
|
}
|
|
755
803
|
|
|
756
804
|
export { TerminalTabList, TerminalTabsListSizes };
|