提交 d6b535ea 编写于 作者: D Daniel Imms

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

Fixes #132519
Fixes microsoft/vscode-remote-release#5556
上级 d97e2812
......@@ -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> {
......
......@@ -1155,7 +1155,8 @@ export class TerminalService implements ITerminalService {
async createTerminal(options?: ICreateTerminalOptions): Promise<ITerminalInstance> {
if (!this._availableProfiles) {
const isPtyTerminal = options?.config && 'customPtyImplementation' in options.config;
if (!isPtyTerminal && !this._availableProfiles) {
await this._refreshAvailableProfilesNow();
}
const config = options?.config || this._availableProfiles?.find(p => p.profileName === this._defaultProfileName);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册