Don't await profiles for custom ptys, ensure createTerminal returns

Fixes #132519
Fixes microsoft/vscode-remote-release#5556
This commit is contained in:
Daniel Imms
2021-09-10 07:57:33 -07:00
parent d97e281265
commit d6b535ea40
2 changed files with 6 additions and 3 deletions

View File

@@ -140,13 +140,15 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
isExtensionOwnedTerminal: launchConfig.isExtensionOwnedTerminal,
useShellEnvironment: launchConfig.useShellEnvironment,
};
this._extHostTerminals.set(extHostTerminalId, new Promise(async r => {
const terminal = new Promise<ITerminalInstance>(async r => {
const terminal = await this._terminalService.createTerminal({
config: shellLaunchConfig,
location: await this._deserializeParentTerminal(launchConfig.location)
});
r(terminal);
}));
});
this._extHostTerminals.set(extHostTerminalId, terminal);
await terminal;
}
private async _deserializeParentTerminal(location?: TerminalLocation | TerminalEditorLocationOptions | { parentTerminal: ExtHostTerminalIdentifier } | { splitActiveTerminal: boolean, location?: TerminalLocation }): Promise<TerminalLocation | TerminalEditorLocationOptions | { parentTerminal: ITerminalInstance } | { splitActiveTerminal: boolean } | undefined> {