提交 9cee230c 编写于 作者: D Daniel Imms

Ensure local terminals can launch before available profiles are ready

Fixes #132519
Fixes microsoft/vscode-remote-release#5556
上级 20388b6d
......@@ -1155,10 +1155,17 @@ export class TerminalService implements ITerminalService {
async createTerminal(options?: ICreateTerminalOptions): Promise<ITerminalInstance> {
const isPtyTerminal = options?.config && 'customPtyImplementation' in options.config;
if (!isPtyTerminal && !this._availableProfiles) {
await this._refreshAvailableProfilesNow();
// Await the initialization of available profiles as long as this is not a pty terminal or a
// local terminal in a remote workspace as profile won't be used in those cases and these
// terminals need to be launched before remote connections are established.
if (!this._availableProfiles) {
const isPtyTerminal = options?.config && 'customPtyImplementation' in options.config;
const isLocalInRemoteTerminal = this._remoteAgentService.getConnection() && URI.isUri(options?.cwd) && options?.cwd.scheme === Schemas.vscodeFileResource;
if (!isPtyTerminal && !isLocalInRemoteTerminal) {
await this._refreshAvailableProfilesNow();
}
}
const config = options?.config || this._availableProfiles?.find(p => p.profileName === this._defaultProfileName);
const shellLaunchConfig = config && 'extensionIdentifier' in config ? {} : this._convertProfileToShellLaunchConfig(config || {});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册