From 88be663f192d65d873b2b372de91f1e2ed9c98b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Fri, 17 Feb 2023 14:00:09 +0100 Subject: [PATCH 1/2] Handle the case where no default terminal profile is set no startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributed on behalf of STMicroelectronics Signed-off-by: Thomas Mäder --- .../src/browser/terminal-frontend-contribution.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/terminal/src/browser/terminal-frontend-contribution.ts b/packages/terminal/src/browser/terminal-frontend-contribution.ts index 3da60326aeb80..db6c9b192036c 100644 --- a/packages/terminal/src/browser/terminal-frontend-contribution.ts +++ b/packages/terminal/src/browser/terminal-frontend-contribution.ts @@ -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 = undefined; switch (OS.backend.type()) { case OS.Type.Windows: { defaultProfileId = this.terminalPreferences['terminal.integrated.defaultProfile.windows']; @@ -271,7 +271,9 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu break; } } - this.profileService.setDefaultProfile(defaultProfileId); + if (defaultProfileId) { + this.profileService.setDefaultProfile(defaultProfileId); + } }); } From b92defd592597626039a989ff998fd6113626e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Tue, 21 Feb 2023 10:05:19 +0100 Subject: [PATCH 2/2] Fix typing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- packages/terminal/src/browser/terminal-frontend-contribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/terminal/src/browser/terminal-frontend-contribution.ts b/packages/terminal/src/browser/terminal-frontend-contribution.ts index db6c9b192036c..143042635eab1 100644 --- a/packages/terminal/src/browser/terminal-frontend-contribution.ts +++ b/packages/terminal/src/browser/terminal-frontend-contribution.ts @@ -256,7 +256,7 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu // extension contributions get read after this point: need to set the default profile if necessary this.profileService.onAdded(id => { - let defaultProfileId = undefined; + let defaultProfileId: string | undefined; switch (OS.backend.type()) { case OS.Type.Windows: { defaultProfileId = this.terminalPreferences['terminal.integrated.defaultProfile.windows'];