Skip to content

Commit d5f6bc6

Browse files
committed
Improve pty host startup marks/logging
Part of microsoft#185393
1 parent d0d9701 commit d5f6bc6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/vs/platform/terminal/node/ptyService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@ export class PtyService extends Disposable implements IPtyService {
506506
if (layout) {
507507
const expandedTabs = await Promise.all(layout.tabs.map(async tab => this._expandTerminalTab(tab)));
508508
const tabs = expandedTabs.filter(t => t.terminals.length > 0);
509-
this._logService.trace('PtyService.getTerminalLayoutInfo result', tabs);
510509
performance.mark('code/didGetTerminalLayoutInfo');
511510
return { tabs };
512511
}

src/vs/workbench/contrib/terminal/electron-sandbox/localTerminalBackend.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
9494
// The pty host should not get launched until the first window restored phase
9595
await this._lifecycleService.when(LifecyclePhase.Restored);
9696

97-
mark('code/willConnectPtyHost');
97+
mark('code/terminal/willConnectPtyHost');
9898
this._logService.trace('Renderer->PtyHost#connect: before acquirePort');
9999
acquirePort('vscode:createPtyHostMessageChannel', 'vscode:createPtyHostMessageChannelResult').then(port => {
100-
mark('code/didConnectPtyHost');
100+
mark('code/terminal/didConnectPtyHost');
101101
this._logService.trace('Renderer->PtyHost#connect: connection established');
102102
// There are two connections to the pty host; one to the regular shared process
103103
// _localPtyService, and one directly via message port _ptyHostDirectProxy. The former is
@@ -279,18 +279,24 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
279279

280280
// Re-resolve the environments and replace it on the state so local terminals use a fresh
281281
// environment
282+
mark('code/terminal/willGetReviveEnvironments');
282283
for (const state of parsed) {
283284
const freshEnv = await this._resolveEnvironmentForRevive(variableResolver, state.shellLaunchConfig);
284285
state.processLaunchConfig.env = freshEnv;
285286
}
287+
mark('code/terminal/didGetReviveEnvironments');
286288

289+
mark('code/terminal/willReviveTerminalProcesses');
287290
await this._localPtyService.reviveTerminalProcesses(parsed, Intl.DateTimeFormat().resolvedOptions().locale);
291+
mark('code/terminal/didReviveTerminalProcesses');
288292
this._storageService.remove(TerminalStorageKeys.TerminalBufferState, StorageScope.WORKSPACE);
289293
// If reviving processes, send the terminal layout info back to the pty host as it
290294
// will not have been persisted on application exit
291295
const layoutInfo = this._storageService.get(TerminalStorageKeys.TerminalLayoutInfo, StorageScope.WORKSPACE);
292296
if (layoutInfo) {
297+
mark('code/terminal/willSetTerminalLayoutInfo');
293298
await this._localPtyService.setTerminalLayoutInfo(JSON.parse(layoutInfo));
299+
mark('code/terminal/didSetTerminalLayoutInfo');
294300
this._storageService.remove(TerminalStorageKeys.TerminalLayoutInfo, StorageScope.WORKSPACE);
295301
}
296302
} catch {

0 commit comments

Comments
 (0)