Skip to content

Commit d209ad8

Browse files
committed
Parallelize fetching each terms revive env
Part of microsoft#186671
1 parent 6314fae commit d209ad8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,12 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
279279
// Re-resolve the environments and replace it on the state so local terminals use a fresh
280280
// environment
281281
mark('code/terminal/willGetReviveEnvironments');
282-
for (const state of parsed) {
283-
const freshEnv = await this._resolveEnvironmentForRevive(variableResolver, state.shellLaunchConfig);
284-
state.processLaunchConfig.env = freshEnv;
285-
}
282+
await Promise.all(parsed.map(state => new Promise<void>(r => {
283+
this._resolveEnvironmentForRevive(variableResolver, state.shellLaunchConfig).then(freshEnv => {
284+
state.processLaunchConfig.env = freshEnv;
285+
r();
286+
});
287+
})));
286288
mark('code/terminal/didGetReviveEnvironments');
287289

288290
mark('code/terminal/willReviveTerminalProcesses');

0 commit comments

Comments
 (0)