From 192768d8393435ea6d7a44ad0c11cf6b8ce09110 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Thu, 4 Nov 2021 06:53:17 -0700 Subject: [PATCH 1/3] fix #136362 --- .../contrib/terminal/browser/terminalProfileService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts b/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts index c0cf25a0403c4..aee1244bec839 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts @@ -34,7 +34,7 @@ export class TerminalProfileService implements ITerminalProfileService { private _profilesReadyBarrier: AutoOpenBarrier; private _availableProfiles: ITerminalProfile[] | undefined; private _contributedProfiles: IExtensionTerminalProfile[] = []; - private _defaultProfileName?: string; + private _defaultProfileName: string | null = null; private readonly _profileProviders: Map> = new Map(); private readonly _primaryOffProcessTerminalService?: IOffProcessTerminalService; @@ -84,7 +84,7 @@ export class TerminalProfileService implements ITerminalProfileService { _serviceBrand: undefined; getDefaultProfileName(): string | undefined { - return this._defaultProfileName; + return this._defaultProfileName === null ? undefined : this._defaultProfileName; } @throttle(2000) From 4f0e12a14b9717170f414ce40fca67ad58b9a759 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Thu, 4 Nov 2021 07:03:59 -0700 Subject: [PATCH 2/3] convert to undefined when getValue happens --- .../contrib/terminal/browser/terminalProfileService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts b/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts index aee1244bec839..ebc64e5a6813a 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts @@ -34,7 +34,7 @@ export class TerminalProfileService implements ITerminalProfileService { private _profilesReadyBarrier: AutoOpenBarrier; private _availableProfiles: ITerminalProfile[] | undefined; private _contributedProfiles: IExtensionTerminalProfile[] = []; - private _defaultProfileName: string | null = null; + private _defaultProfileName?: string; private readonly _profileProviders: Map> = new Map(); private readonly _primaryOffProcessTerminalService?: IOffProcessTerminalService; @@ -139,7 +139,7 @@ export class TerminalProfileService implements ITerminalProfileService { return this._availableProfiles || []; } const platform = await this._getPlatformKey(); - this._defaultProfileName = this._configurationService.getValue(`${TerminalSettingPrefix.DefaultProfile}${platform}`); + this._defaultProfileName = this._configurationService.getValue(`${TerminalSettingPrefix.DefaultProfile}${platform}`) ?? undefined; return this._primaryOffProcessTerminalService?.getProfiles(this._configurationService.getValue(`${TerminalSettingPrefix.Profiles}${platform}`), this._defaultProfileName, includeDetectedProfiles); } From d0dcd79bb97df82c4188ba871d71129018f86ca2 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Thu, 4 Nov 2021 07:04:47 -0700 Subject: [PATCH 3/3] remove conversion --- .../contrib/terminal/browser/terminalProfileService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts b/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts index ebc64e5a6813a..b88221b2876f3 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts @@ -84,7 +84,7 @@ export class TerminalProfileService implements ITerminalProfileService { _serviceBrand: undefined; getDefaultProfileName(): string | undefined { - return this._defaultProfileName === null ? undefined : this._defaultProfileName; + return this._defaultProfileName; } @throttle(2000)