@codingame/monaco-vscode-xterm-common 25.1.2 → 26.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/package.json +4 -4
  2. package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +2 -2
  3. package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +20 -16
  4. package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +20 -11
  5. package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +15 -21
  6. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +386 -301
  7. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +11 -2
  8. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.js +4 -8
  9. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.d.ts +0 -4
  10. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +792 -548
  11. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.d.ts +1 -1
  12. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +225 -128
  13. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +14 -5
  14. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +23 -19
  15. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +174 -126
  16. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +29 -22
  17. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +3 -1
  18. package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +112 -114
  19. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +2 -1
  20. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +16 -15
  21. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +14 -14
  22. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.js +33 -23
  23. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.d.ts +2 -1
  24. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +115 -84
@@ -31,7 +31,7 @@ import { IAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/pl
31
31
  *
32
32
  * Internal definitions:
33
33
  * - Process: The process launched with the terminalProcess.ts file, or the pty as a whole
34
- * - Pty Process: The pseudoterminal parent process (or the conpty/winpty agent process)
34
+ * - Pty Process: The pseudoterminal parent process (or the conpty agent process)
35
35
  * - Shell Process: The pseudoterminal child process (ie. the shell)
36
36
  */
37
37
  export declare class TerminalProcessManager extends Disposable implements ITerminalProcessManager {
@@ -44,24 +44,61 @@ import { BugIndicatingError } from '@codingame/monaco-vscode-api/vscode/vs/base/
44
44
  import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
45
45
 
46
46
  var ProcessConstants;
47
- (function (ProcessConstants) {
47
+ (function(ProcessConstants) {
48
48
  ProcessConstants[ProcessConstants["ErrorLaunchThresholdDuration"] = 500] = "ErrorLaunchThresholdDuration";
49
49
  ProcessConstants[ProcessConstants["LatencyMeasuringInterval"] = 1000] = "LatencyMeasuringInterval";
50
50
  })(ProcessConstants || (ProcessConstants = {}));
51
51
  var ProcessType;
52
- (function (ProcessType) {
52
+ (function(ProcessType) {
53
53
  ProcessType[ProcessType["Process"] = 0] = "Process";
54
54
  ProcessType[ProcessType["PsuedoTerminal"] = 1] = "PsuedoTerminal";
55
55
  })(ProcessType || (ProcessType = {}));
56
56
  let TerminalProcessManager = class TerminalProcessManager extends Disposable {
57
- get persistentProcessId() { return this._process?.id; }
58
- get shouldPersist() { return !!this.reconnectionProperties || (this._process ? this._process.shouldPersist : false); }
59
- get hasWrittenData() { return this._hasWrittenData; }
60
- get hasChildProcesses() { return this._hasChildProcesses; }
61
- get reconnectionProperties() { return this._shellLaunchConfig?.attachPersistentProcess?.reconnectionProperties || this._shellLaunchConfig?.reconnectionProperties || undefined; }
62
- get extEnvironmentVariableCollection() { return this._extEnvironmentVariableCollection; }
63
- get processTraits() { return this._processTraits; }
64
- constructor(_instanceId, cwd, environmentVariableCollections, shellIntegrationNonce, _historyService, _instantiationService, _logService, _workspaceContextService, _configurationResolverService, _workbenchEnvironmentService, _productService, _remoteAgentService, _pathService, _environmentVariableService, _terminalConfigurationService, _terminalProfileResolverService, _configurationService, _terminalInstanceService, _telemetryService, _notificationService, _accessibilityService, _terminalService) {
57
+ get persistentProcessId() {
58
+ return this._process?.id;
59
+ }
60
+ get shouldPersist() {
61
+ return !!this.reconnectionProperties || (this._process ? this._process.shouldPersist : false);
62
+ }
63
+ get hasWrittenData() {
64
+ return this._hasWrittenData;
65
+ }
66
+ get hasChildProcesses() {
67
+ return this._hasChildProcesses;
68
+ }
69
+ get reconnectionProperties() {
70
+ return this._shellLaunchConfig?.attachPersistentProcess?.reconnectionProperties || this._shellLaunchConfig?.reconnectionProperties || undefined;
71
+ }
72
+ get extEnvironmentVariableCollection() {
73
+ return this._extEnvironmentVariableCollection;
74
+ }
75
+ get processTraits() {
76
+ return this._processTraits;
77
+ }
78
+ constructor(
79
+ _instanceId,
80
+ cwd,
81
+ environmentVariableCollections,
82
+ shellIntegrationNonce,
83
+ _historyService,
84
+ _instantiationService,
85
+ _logService,
86
+ _workspaceContextService,
87
+ _configurationResolverService,
88
+ _workbenchEnvironmentService,
89
+ _productService,
90
+ _remoteAgentService,
91
+ _pathService,
92
+ _environmentVariableService,
93
+ _terminalConfigurationService,
94
+ _terminalProfileResolverService,
95
+ _configurationService,
96
+ _terminalInstanceService,
97
+ _telemetryService,
98
+ _notificationService,
99
+ _accessibilityService,
100
+ _terminalService
101
+ ) {
65
102
  super();
66
103
  this._instanceId = _instanceId;
67
104
  this._historyService = _historyService;
@@ -93,7 +130,10 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
93
130
  this._hasChildProcesses = false;
94
131
  this._ptyListenersAttached = false;
95
132
  this._isDisconnected = false;
96
- this._dimensions = { cols: 0, rows: 0 };
133
+ this._dimensions = {
134
+ cols: 0,
135
+ rows: 0
136
+ };
97
137
  this._onPtyDisconnect = this._register(( new Emitter()));
98
138
  this.onPtyDisconnect = this._onPtyDisconnect.event;
99
139
  this._onPtyReconnect = this._register(( new Emitter()));
@@ -122,25 +162,34 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
122
162
  this._dataFilter = this._register(this._instantiationService.createInstance(SeamlessRelaunchDataFilter));
123
163
  this._register(this._dataFilter.onProcessData(ev => {
124
164
  const data = (isString(ev) ? ev : ev.data);
125
- const beforeProcessDataEvent = { data };
165
+ const beforeProcessDataEvent = {
166
+ data
167
+ };
126
168
  this._onBeforeProcessData.fire(beforeProcessDataEvent);
127
169
  if (beforeProcessDataEvent.data && beforeProcessDataEvent.data.length > 0) {
128
170
  if (!isString(ev)) {
129
171
  ev.data = beforeProcessDataEvent.data;
130
172
  }
131
- this._onProcessData.fire(!isString(ev) ? ev : { data: beforeProcessDataEvent.data, trackCommit: false });
173
+ this._onProcessData.fire(!isString(ev) ? ev : {
174
+ data: beforeProcessDataEvent.data,
175
+ trackCommit: false
176
+ });
132
177
  }
133
178
  }));
134
- if (cwd && typeof cwd === 'object') {
179
+ if (cwd && typeof cwd === "object") {
135
180
  this.remoteAuthority = getRemoteAuthority(cwd);
136
- }
137
- else {
181
+ } else {
138
182
  this.remoteAuthority = this._workbenchEnvironmentService.remoteAuthority;
139
183
  }
140
184
  if (environmentVariableCollections) {
141
185
  this._extEnvironmentVariableCollection = ( new MergedEnvironmentVariableCollection(environmentVariableCollections));
142
- this._register(this._environmentVariableService.onDidChangeCollections(newCollection => this._onEnvironmentVariableCollectionChange(newCollection)));
143
- this.environmentVariableInfo = this._instantiationService.createInstance(EnvironmentVariableInfoChangesActive, this._extEnvironmentVariableCollection);
186
+ this._register(this._environmentVariableService.onDidChangeCollections(
187
+ newCollection => this._onEnvironmentVariableCollectionChange(newCollection)
188
+ ));
189
+ this.environmentVariableInfo = this._instantiationService.createInstance(
190
+ EnvironmentVariableInfoChangesActive,
191
+ this._extEnvironmentVariableCollection
192
+ );
144
193
  this._onEnvironmentVariableInfoChange.fire(this.environmentVariableInfo);
145
194
  }
146
195
  this.shellIntegrationNonce = shellIntegrationNonce ?? generateUuid();
@@ -150,14 +199,16 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
150
199
  if (this._process?.freePortKillProcess) {
151
200
  await this._process?.freePortKillProcess(port);
152
201
  }
153
- }
154
- catch (e) {
155
- this._notificationService.notify({ message: ( localize(
156
- 11638,
157
- 'Could not kill process listening on port {0}, command exited with error {1}',
158
- port,
159
- e
160
- )), severity: Severity.Warning });
202
+ } catch (e) {
203
+ this._notificationService.notify({
204
+ message: ( localize(
205
+ 11962,
206
+ "Could not kill process listening on port {0}, command exited with error {1}",
207
+ port,
208
+ e
209
+ )),
210
+ severity: Severity.Warning
211
+ });
161
212
  }
162
213
  }
163
214
  dispose(immediate = false) {
@@ -195,8 +246,7 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
195
246
  if (shellLaunchConfig.customPtyImplementation) {
196
247
  this._processType = ProcessType.PsuedoTerminal;
197
248
  newProcess = shellLaunchConfig.customPtyImplementation(this._instanceId, cols, rows);
198
- }
199
- else {
249
+ } else {
200
250
  const backend = await this._terminalInstanceService.getBackend(this.remoteAuthority);
201
251
  if (!backend) {
202
252
  throw ( new Error(
@@ -204,7 +254,11 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
204
254
  ));
205
255
  }
206
256
  this.backend = backend;
207
- const variableResolver = createVariableResolver(this._cwdWorkspaceFolder, await this._terminalProfileResolverService.getEnvironment(this.remoteAuthority), this._configurationResolverService);
257
+ const variableResolver = createVariableResolver(
258
+ this._cwdWorkspaceFolder,
259
+ await this._terminalProfileResolverService.getEnvironment(this.remoteAuthority),
260
+ this._configurationResolverService
261
+ );
208
262
  this.userHome = this._pathService.resolvedUserHome?.fsPath;
209
263
  this.os = OS;
210
264
  if (!!this.remoteAuthority) {
@@ -224,9 +278,11 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
224
278
  const result = await backend.attachToProcess(shellLaunchConfig.attachPersistentProcess.id);
225
279
  if (result) {
226
280
  newProcess = result;
227
- }
228
- else {
229
- this._logService.warn(`Attach to process failed for terminal`, shellLaunchConfig.attachPersistentProcess);
281
+ } else {
282
+ this._logService.warn(
283
+ `Attach to process failed for terminal`,
284
+ shellLaunchConfig.attachPersistentProcess
285
+ );
230
286
  shellLaunchConfig.attachPersistentProcess = undefined;
231
287
  }
232
288
  }
@@ -241,19 +297,17 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
241
297
  suggestEnabled: this._configurationService.getValue(TerminalContribSettingId.SuggestEnabled),
242
298
  nonce: this.shellIntegrationNonce
243
299
  },
244
- windowsEnableConpty: this._terminalConfigurationService.config.windowsEnableConpty,
245
300
  windowsUseConptyDll: this._terminalConfigurationService.config.windowsUseConptyDll ?? false,
246
301
  environmentVariableCollections: this._extEnvironmentVariableCollection?.collections ? serializeEnvironmentVariableCollections(this._extEnvironmentVariableCollection.collections) : undefined,
247
302
  workspaceFolder: this._cwdWorkspaceFolder,
248
303
  isScreenReaderOptimized: this._accessibilityService.isScreenReaderOptimized()
249
304
  };
250
305
  try {
251
- newProcess = await backend.createProcess(shellLaunchConfig, '',
306
+ newProcess = await backend.createProcess(shellLaunchConfig, "",
252
307
  cols, rows, this._terminalConfigurationService.config.unicodeVersion, env,
253
308
  options, shouldPersist);
254
- }
255
- catch (e) {
256
- if (e?.message === 'Could not fetch remote environment') {
309
+ } catch (e) {
310
+ if (e?.message === "Could not fetch remote environment") {
257
311
  this._logService.trace(`Could not fetch remote environment, silently failing`);
258
312
  return undefined;
259
313
  }
@@ -263,15 +317,16 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
263
317
  if (!this._isDisposed) {
264
318
  this._setupPtyHostListeners(backend);
265
319
  }
266
- }
267
- else {
320
+ } else {
268
321
  if (shellLaunchConfig.attachPersistentProcess) {
269
322
  const result = shellLaunchConfig.attachPersistentProcess.findRevivedId ? await backend.attachToRevivedProcess(shellLaunchConfig.attachPersistentProcess.id) : await backend.attachToProcess(shellLaunchConfig.attachPersistentProcess.id);
270
323
  if (result) {
271
324
  newProcess = result;
272
- }
273
- else {
274
- this._logService.warn(`Attach to process failed for terminal`, shellLaunchConfig.attachPersistentProcess);
325
+ } else {
326
+ this._logService.warn(
327
+ `Attach to process failed for terminal`,
328
+ shellLaunchConfig.attachPersistentProcess
329
+ );
275
330
  shellLaunchConfig.attachPersistentProcess = undefined;
276
331
  }
277
332
  }
@@ -296,34 +351,43 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
296
351
  if (this._processListeners) {
297
352
  dispose(this._processListeners);
298
353
  }
299
- this._processListeners = [
300
- newProcess.onProcessReady((e) => {
301
- this._processTraits = e;
302
- this.shellProcessId = e.pid;
303
- this._initialCwd = e.cwd;
304
- this.processReadyTimestamp = Date.now();
305
- this._onDidChangeProperty.fire({ type: ProcessPropertyType.InitialCwd, value: this._initialCwd });
306
- this._onProcessReady.fire(e);
307
- if (this._preLaunchInputQueue.length > 0 && this._process) {
308
- newProcess.input(this._preLaunchInputQueue.join(''));
309
- this._preLaunchInputQueue.length = 0;
310
- }
311
- }),
312
- newProcess.onProcessExit(exitCode => this._onExit(exitCode)),
313
- newProcess.onDidChangeProperty(({ type, value }) => {
314
- switch (type) {
315
- case ProcessPropertyType.HasChildProcesses:
316
- this._hasChildProcesses = value;
317
- break;
318
- case ProcessPropertyType.FailedShellIntegrationActivation:
319
- this._telemetryService?.publicLog2('terminal/shellIntegrationActivationFailureCustomArgs');
320
- break;
321
- }
322
- this._onDidChangeProperty.fire({ type, value });
323
- })
324
- ];
354
+ this._processListeners = [newProcess.onProcessReady(e => {
355
+ this._processTraits = e;
356
+ this.shellProcessId = e.pid;
357
+ this._initialCwd = e.cwd;
358
+ this.processReadyTimestamp = Date.now();
359
+ this._onDidChangeProperty.fire({
360
+ type: ProcessPropertyType.InitialCwd,
361
+ value: this._initialCwd
362
+ });
363
+ this._onProcessReady.fire(e);
364
+ if (this._preLaunchInputQueue.length > 0 && this._process) {
365
+ newProcess.input(this._preLaunchInputQueue.join(""));
366
+ this._preLaunchInputQueue.length = 0;
367
+ }
368
+ }), newProcess.onProcessExit(exitCode => this._onExit(exitCode)), newProcess.onDidChangeProperty((
369
+ {
370
+ type,
371
+ value
372
+ }
373
+ ) => {
374
+ switch (type) {
375
+ case ProcessPropertyType.HasChildProcesses:
376
+ this._hasChildProcesses = value;
377
+ break;
378
+ case ProcessPropertyType.FailedShellIntegrationActivation:
379
+ this._telemetryService?.publicLog2("terminal/shellIntegrationActivationFailureCustomArgs");
380
+ break;
381
+ }
382
+ this._onDidChangeProperty.fire({
383
+ type,
384
+ value
385
+ });
386
+ })];
325
387
  if (newProcess.onProcessReplayComplete) {
326
- this._processListeners.push(newProcess.onProcessReplayComplete(() => this._onProcessReplayComplete.fire()));
388
+ this._processListeners.push(
389
+ newProcess.onProcessReplayComplete(() => this._onProcessReplayComplete.fire())
390
+ );
327
391
  }
328
392
  if (newProcess.onRestoreCommands) {
329
393
  this._processListeners.push(newProcess.onRestoreCommands(e => this._onRestoreCommands.fire(e)));
@@ -339,7 +403,9 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
339
403
  }
340
404
  runWhenWindowIdle(getActiveWindow(), () => {
341
405
  this.backend?.getLatency().then(measurements => {
342
- this._logService.info(`Latency measurements for ${this.remoteAuthority ?? 'local'} backend\n${( measurements.map(e => `${e.label}: ${e.latency.toFixed(2)}ms`)).join('\n')}`);
406
+ this._logService.info(
407
+ `Latency measurements for ${this.remoteAuthority ?? "local"} backend\n${( measurements.map(e => `${e.label}: ${e.latency.toFixed(2)}ms`)).join("\n")}`
408
+ );
343
409
  });
344
410
  });
345
411
  return undefined;
@@ -356,26 +422,41 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
356
422
  }
357
423
  async _resolveEnvironment(backend, variableResolver, shellLaunchConfig) {
358
424
  const workspaceFolder = getWorkspaceForTerminal(shellLaunchConfig.cwd, this._workspaceContextService, this._historyService);
359
- const platformKey = isWindows ? 'windows' : (isMacintosh ? 'osx' : 'linux');
425
+ const platformKey = isWindows ? "windows" : (isMacintosh ? "osx" : "linux");
360
426
  const envFromConfigValue = this._configurationService.getValue(`terminal.integrated.env.${platformKey}`);
361
427
  let baseEnv;
362
428
  if (shellLaunchConfig.useShellEnvironment) {
363
429
  const shellEnv = await backend.getShellEnvironment();
364
430
  if (!shellEnv) {
365
- throw ( new BugIndicatingError('Cannot fetch shell environment to use'));
431
+ throw ( new BugIndicatingError("Cannot fetch shell environment to use"));
366
432
  }
367
433
  baseEnv = shellEnv;
368
- }
369
- else {
434
+ } else {
370
435
  baseEnv = await this._terminalProfileResolverService.getEnvironment(this.remoteAuthority);
371
436
  }
372
- const env = await createTerminalEnvironment(shellLaunchConfig, envFromConfigValue, variableResolver, this._productService.version, this._terminalConfigurationService.config.detectLocale, baseEnv);
437
+ const env = await createTerminalEnvironment(
438
+ shellLaunchConfig,
439
+ envFromConfigValue,
440
+ variableResolver,
441
+ this._productService.version,
442
+ this._terminalConfigurationService.config.detectLocale,
443
+ baseEnv
444
+ );
373
445
  if (!this._isDisposed && shouldUseEnvironmentVariableCollection(shellLaunchConfig)) {
374
446
  this._extEnvironmentVariableCollection = this._environmentVariableService.mergedCollection;
375
- this._register(this._environmentVariableService.onDidChangeCollections(newCollection => this._onEnvironmentVariableCollectionChange(newCollection)));
376
- await this._extEnvironmentVariableCollection.applyToProcessEnvironment(env, { workspaceFolder }, variableResolver);
377
- if (this._extEnvironmentVariableCollection.getVariableMap({ workspaceFolder }).size) {
378
- this.environmentVariableInfo = this._instantiationService.createInstance(EnvironmentVariableInfoChangesActive, this._extEnvironmentVariableCollection);
447
+ this._register(this._environmentVariableService.onDidChangeCollections(
448
+ newCollection => this._onEnvironmentVariableCollectionChange(newCollection)
449
+ ));
450
+ await this._extEnvironmentVariableCollection.applyToProcessEnvironment(env, {
451
+ workspaceFolder
452
+ }, variableResolver);
453
+ if (this._extEnvironmentVariableCollection.getVariableMap({
454
+ workspaceFolder
455
+ }).size) {
456
+ this.environmentVariableInfo = this._instantiationService.createInstance(
457
+ EnvironmentVariableInfoChangesActive,
458
+ this._extEnvironmentVariableCollection
459
+ );
379
460
  this._onEnvironmentVariableInfoChange.fire(this.environmentVariableInfo);
380
461
  }
381
462
  }
@@ -387,7 +468,14 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
387
468
  os: OS
388
469
  });
389
470
  const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(Schemas.file);
390
- const initialCwd = await getCwd(shellLaunchConfig, userHome, variableResolver, activeWorkspaceRootUri, this._terminalConfigurationService.config.cwd, this._logService);
471
+ const initialCwd = await getCwd(
472
+ shellLaunchConfig,
473
+ userHome,
474
+ variableResolver,
475
+ activeWorkspaceRootUri,
476
+ this._terminalConfigurationService.config.cwd,
477
+ this._logService
478
+ );
391
479
  const env = await this._resolveEnvironment(backend, variableResolver, shellLaunchConfig);
392
480
  const options = {
393
481
  shellIntegration: {
@@ -395,14 +483,22 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
395
483
  suggestEnabled: this._configurationService.getValue(TerminalContribSettingId.SuggestEnabled),
396
484
  nonce: this.shellIntegrationNonce
397
485
  },
398
- windowsEnableConpty: this._terminalConfigurationService.config.windowsEnableConpty,
399
486
  windowsUseConptyDll: this._terminalConfigurationService.config.windowsUseConptyDll ?? false,
400
487
  environmentVariableCollections: this._extEnvironmentVariableCollection ? serializeEnvironmentVariableCollections(this._extEnvironmentVariableCollection.collections) : undefined,
401
488
  workspaceFolder: this._cwdWorkspaceFolder,
402
489
  isScreenReaderOptimized: this._accessibilityService.isScreenReaderOptimized()
403
490
  };
404
491
  const shouldPersist = ((this._configurationService.getValue(TaskSettingId.Reconnection) && shellLaunchConfig.reconnectionProperties) || !shellLaunchConfig.isFeatureTerminal) && this._terminalConfigurationService.config.enablePersistentSessions && !shellLaunchConfig.isTransient;
405
- return await backend.createProcess(shellLaunchConfig, initialCwd, cols, rows, this._terminalConfigurationService.config.unicodeVersion, env, options, shouldPersist);
492
+ return await backend.createProcess(
493
+ shellLaunchConfig,
494
+ initialCwd,
495
+ cols,
496
+ rows,
497
+ this._terminalConfigurationService.config.unicodeVersion,
498
+ env,
499
+ options,
500
+ shouldPersist
501
+ );
406
502
  }
407
503
  _setupPtyHostListeners(backend) {
408
504
  if (this._ptyListenersAttached) {
@@ -428,17 +524,29 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
428
524
  if (this._shellLaunchConfig) {
429
525
  if (this._shellLaunchConfig.isFeatureTerminal && !this.reconnectionProperties) {
430
526
  this._onExit(-1);
431
- }
432
- else {
527
+ } else {
433
528
  const message = ( localize(
434
- 11639,
529
+ 11963,
435
530
  "Restarting the terminal because the connection to the shell process was lost..."
436
531
  ));
437
- this._onProcessData.fire({ data: formatMessageForTerminal(message, { loudFormatting: true }), trackCommit: false });
438
- await this.relaunch(this._shellLaunchConfig, this._dimensions.cols, this._dimensions.rows, false);
532
+ this._onProcessData.fire({
533
+ data: formatMessageForTerminal(message, {
534
+ loudFormatting: true
535
+ }),
536
+ trackCommit: false
537
+ });
538
+ await this.relaunch(
539
+ this._shellLaunchConfig,
540
+ this._dimensions.cols,
541
+ this._dimensions.rows,
542
+ false
543
+ );
439
544
  }
440
545
  }
441
546
  }));
547
+ this._register(toDisposable(() => {
548
+ this.ptyProcessReady = undefined;
549
+ }));
442
550
  }
443
551
  async getBackendOS() {
444
552
  let os = OS;
@@ -477,10 +585,9 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
477
585
  }
478
586
  try {
479
587
  this._process.resize(cols, rows);
480
- }
481
- catch (error) {
482
- if (error.code !== 'EPIPE' && error.code !== 'ERR_IPC_CHANNEL_CLOSED') {
483
- throw (error);
588
+ } catch (error) {
589
+ if (error.code !== "EPIPE" && error.code !== "ERR_IPC_CHANNEL_CLOSED") {
590
+ throw error;
484
591
  }
485
592
  }
486
593
  this._dimensions.cols = cols;
@@ -494,8 +601,7 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
494
601
  if (this._process) {
495
602
  this._process.input(data);
496
603
  }
497
- }
498
- else {
604
+ } else {
499
605
  this._preLaunchInputQueue.push(data);
500
606
  }
501
607
  }
@@ -512,11 +618,11 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
512
618
  this._process?.processBinary(data);
513
619
  }
514
620
  get initialCwd() {
515
- return this._initialCwd ?? '';
621
+ return this._initialCwd ?? "";
516
622
  }
517
623
  async refreshProperty(type) {
518
624
  if (!this._process) {
519
- throw ( new Error('Cannot refresh property when process is not set'));
625
+ throw ( new Error("Cannot refresh property when process is not set"));
520
626
  }
521
627
  return this._process.refreshProperty(type);
522
628
  }
@@ -541,10 +647,15 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
541
647
  this._onProcessStateChange.fire();
542
648
  }
543
649
  _onEnvironmentVariableCollectionChange(newCollection) {
544
- const diff = this._extEnvironmentVariableCollection.diff(newCollection, { workspaceFolder: this._cwdWorkspaceFolder });
650
+ const diff = this._extEnvironmentVariableCollection.diff(newCollection, {
651
+ workspaceFolder: this._cwdWorkspaceFolder
652
+ });
545
653
  if (diff === undefined) {
546
654
  if (this.environmentVariableInfo instanceof EnvironmentVariableInfoStale) {
547
- this.environmentVariableInfo = this._instantiationService.createInstance(EnvironmentVariableInfoChangesActive, this._extEnvironmentVariableCollection);
655
+ this.environmentVariableInfo = this._instantiationService.createInstance(
656
+ EnvironmentVariableInfoChangesActive,
657
+ this._extEnvironmentVariableCollection
658
+ );
548
659
  this._onEnvironmentVariableInfoChange.fire(this.environmentVariableInfo);
549
660
  }
550
661
  return;
@@ -556,26 +667,7 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
556
667
  this._process?.clearBuffer?.();
557
668
  }
558
669
  };
559
- TerminalProcessManager = ( __decorate([
560
- ( __param(4, IHistoryService)),
561
- ( __param(5, IInstantiationService)),
562
- ( __param(6, ITerminalLogService)),
563
- ( __param(7, IWorkspaceContextService)),
564
- ( __param(8, IConfigurationResolverService)),
565
- ( __param(9, IWorkbenchEnvironmentService)),
566
- ( __param(10, IProductService)),
567
- ( __param(11, IRemoteAgentService)),
568
- ( __param(12, IPathService)),
569
- ( __param(13, IEnvironmentVariableService)),
570
- ( __param(14, ITerminalConfigurationService)),
571
- ( __param(15, ITerminalProfileResolverService)),
572
- ( __param(16, IConfigurationService)),
573
- ( __param(17, ITerminalInstanceService)),
574
- ( __param(18, ITelemetryService)),
575
- ( __param(19, INotificationService)),
576
- ( __param(20, IAccessibilityService)),
577
- ( __param(21, ITerminalService))
578
- ], TerminalProcessManager));
670
+ TerminalProcessManager = ( __decorate([( __param(4, IHistoryService)), ( __param(5, IInstantiationService)), ( __param(6, ITerminalLogService)), ( __param(7, IWorkspaceContextService)), ( __param(8, IConfigurationResolverService)), ( __param(9, IWorkbenchEnvironmentService)), ( __param(10, IProductService)), ( __param(11, IRemoteAgentService)), ( __param(12, IPathService)), ( __param(13, IEnvironmentVariableService)), ( __param(14, ITerminalConfigurationService)), ( __param(15, ITerminalProfileResolverService)), ( __param(16, IConfigurationService)), ( __param(17, ITerminalInstanceService)), ( __param(18, ITelemetryService)), ( __param(19, INotificationService)), ( __param(20, IAccessibilityService)), ( __param(21, ITerminalService))], TerminalProcessManager));
579
671
  class AckDataBufferer {
580
672
  constructor(_callback) {
581
673
  this._callback = _callback;
@@ -590,12 +682,14 @@ class AckDataBufferer {
590
682
  }
591
683
  }
592
684
  var SeamlessRelaunchConstants;
593
- (function (SeamlessRelaunchConstants) {
685
+ (function(SeamlessRelaunchConstants) {
594
686
  SeamlessRelaunchConstants[SeamlessRelaunchConstants["RecordTerminalDuration"] = 10000] = "RecordTerminalDuration";
595
687
  SeamlessRelaunchConstants[SeamlessRelaunchConstants["SwapWaitMaximumDuration"] = 3000] = "SwapWaitMaximumDuration";
596
688
  })(SeamlessRelaunchConstants || (SeamlessRelaunchConstants = {}));
597
689
  let SeamlessRelaunchDataFilter = class SeamlessRelaunchDataFilter extends Disposable {
598
- get onProcessData() { return this._onProcessData.event; }
690
+ get onProcessData() {
691
+ return this._onProcessData.event;
692
+ }
599
693
  constructor(_logService) {
600
694
  super();
601
695
  this._logService = _logService;
@@ -612,7 +706,7 @@ let SeamlessRelaunchDataFilter = class SeamlessRelaunchDataFilter extends Dispos
612
706
  if (!this._firstRecorder || !reset || this._disableSeamlessRelaunch) {
613
707
  [this._firstRecorder, this._firstDisposable.value] = this._createRecorder(process);
614
708
  if (this._disableSeamlessRelaunch && reset) {
615
- this._onProcessData.fire('\x1bc');
709
+ this._onProcessData.fire("\u001bc");
616
710
  }
617
711
  this._dataListener.value = process.onProcessData(e => this._onProcessData.fire(e));
618
712
  this._disableSeamlessRelaunch = false;
@@ -621,7 +715,10 @@ let SeamlessRelaunchDataFilter = class SeamlessRelaunchDataFilter extends Dispos
621
715
  if (this._secondRecorder) {
622
716
  this.triggerSwap();
623
717
  }
624
- this._swapTimeout = mainWindow.setTimeout(() => this.triggerSwap(), SeamlessRelaunchConstants.SwapWaitMaximumDuration);
718
+ this._swapTimeout = mainWindow.setTimeout(
719
+ () => this.triggerSwap(),
720
+ SeamlessRelaunchConstants.SwapWaitMaximumDuration
721
+ );
625
722
  this._dataListener.clear();
626
723
  this._firstDisposable.clear();
627
724
  const recorder = this._createRecorder(process);
@@ -649,10 +746,12 @@ let SeamlessRelaunchDataFilter = class SeamlessRelaunchDataFilter extends Dispos
649
746
  const secondData = this._getDataFromRecorder(this._secondRecorder);
650
747
  if (firstData === secondData) {
651
748
  this._logService.trace(`Seamless terminal relaunch - identical content`);
652
- }
653
- else {
749
+ } else {
654
750
  this._logService.trace(`Seamless terminal relaunch - resetting content`);
655
- this._onProcessData.fire({ data: `\x1bc${secondData}`, trackCommit: false });
751
+ this._onProcessData.fire({
752
+ data: `\x1bc${secondData}`,
753
+ trackCommit: false
754
+ });
656
755
  }
657
756
  this._dataListener.value = this._activeProcess.onProcessData(e => this._onProcessData.fire(e));
658
757
  this._firstRecorder = this._secondRecorder;
@@ -674,11 +773,9 @@ let SeamlessRelaunchDataFilter = class SeamlessRelaunchDataFilter extends Dispos
674
773
  return [recorder, disposable];
675
774
  }
676
775
  _getDataFromRecorder(recorder) {
677
- return ( recorder.generateReplayEventSync().events.filter(e => !!e.data).map(e => e.data)).join('');
776
+ return ( recorder.generateReplayEventSync().events.filter(e => !!e.data).map(e => e.data)).join("");
678
777
  }
679
778
  };
680
- SeamlessRelaunchDataFilter = ( __decorate([
681
- ( __param(0, ITerminalLogService))
682
- ], SeamlessRelaunchDataFilter));
779
+ SeamlessRelaunchDataFilter = ( __decorate([( __param(0, ITerminalLogService))], SeamlessRelaunchDataFilter));
683
780
 
684
781
  export { TerminalProcessManager };
@@ -5,11 +5,17 @@ import { debounce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/dec
5
5
  import { Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
6
 
7
7
  var Constants;
8
- (function (Constants) {
8
+ (function(Constants) {
9
9
  Constants[Constants["StartDebouncingThreshold"] = 200] = "StartDebouncingThreshold";
10
10
  })(Constants || (Constants = {}));
11
11
  class TerminalResizeDebouncer extends Disposable {
12
- constructor(_isVisible, _getXterm, _resizeBothCallback, _resizeXCallback, _resizeYCallback) {
12
+ constructor(
13
+ _isVisible,
14
+ _getXterm,
15
+ _resizeBothCallback,
16
+ _resizeXCallback,
17
+ _resizeYCallback
18
+ ) {
13
19
  super();
14
20
  this._isVisible = _isVisible;
15
21
  this._getXterm = _getXterm;
@@ -61,8 +67,11 @@ class TerminalResizeDebouncer extends Disposable {
61
67
  this._resizeXCallback(cols);
62
68
  }
63
69
  }
64
- TerminalResizeDebouncer.__decorator = ( __decorate([
65
- debounce(100)
66
- ], TerminalResizeDebouncer.prototype, "_debounceResizeX", null));
70
+ TerminalResizeDebouncer.__decorator = ( __decorate(
71
+ [debounce(100)],
72
+ TerminalResizeDebouncer.prototype,
73
+ "_debounceResizeX",
74
+ null
75
+ ));
67
76
 
68
77
  export { TerminalResizeDebouncer };