Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMegan Rogge <merogge@microsoft.com>2022-06-08 20:06:10 +0300
committerGitHub <noreply@github.com>2022-06-08 20:06:10 +0300
commit4213c8e810e8105fa729967587a53c62eca69f9f (patch)
treee8b21988f634de110cb930114d9544ea15f997eb
parenta7d2cfe5c56ac960584c9b8a7127fd5450792aa4 (diff)
add condition for awaiting profiles in `createTerminal` (#151482)
check if length is 0
-rw-r--r--src/vs/workbench/contrib/terminal/browser/terminalService.ts10
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());