diff options
author | Megan Rogge <merogge@microsoft.com> | 2022-06-08 20:06:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 20:06:10 +0300 |
commit | 4213c8e810e8105fa729967587a53c62eca69f9f (patch) | |
tree | e8b21988f634de110cb930114d9544ea15f997eb /src/vs | |
parent | a7d2cfe5c56ac960584c9b8a7127fd5450792aa4 (diff) |
add condition for awaiting profiles in `createTerminal` (#151482)
check if length is 0
Diffstat (limited to 'src/vs')
-rw-r--r-- | src/vs/workbench/contrib/terminal/browser/terminalService.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vs/workbench/contrib/terminal/browser/terminalService.ts b/src/vs/workbench/contrib/terminal/browser/terminalService.ts index 06a447308f8..99fce5560f7 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalService.ts @@ -929,10 +929,12 @@ export class TerminalService implements ITerminalService { // 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. - 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._terminalProfileService.profilesReady; + if (this._terminalProfileService.availableProfiles.length === 0) { + 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._terminalProfileService.profilesReady; + } } const config = options?.config || this._terminalProfileService.availableProfiles?.find(p => p.profileName === this._terminalProfileService.getDefaultProfileName()); |