Skip to content

Commit

Permalink
Handle the case where no default terminal profile is set no startup. F…
Browse files Browse the repository at this point in the history
…ixes #12119

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
  • Loading branch information
tsmaeder authored Feb 21, 2023
1 parent 5611541 commit 798366f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu
});
this.mergePreferencesPromise = this.mergePreferencesPromise.finally(() => this.mergePreferences());

// extension contributions get read after this point: need to set the default profile if necessary
this.profileService.onAdded(id => {
// extension contributions get read after this point: need to set the default profile if necessary
let defaultProfileId;
let defaultProfileId: string | undefined;
switch (OS.backend.type()) {
case OS.Type.Windows: {
defaultProfileId = this.terminalPreferences['terminal.integrated.defaultProfile.windows'];
Expand All @@ -271,7 +271,9 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu
break;
}
}
this.profileService.setDefaultProfile(defaultProfileId);
if (defaultProfileId) {
this.profileService.setDefaultProfile(defaultProfileId);
}
});
}

Expand Down

0 comments on commit 798366f

Please sign in to comment.