don't involve terminalService

This commit is contained in:
meganrogge 2021-06-04 13:29:48 -07:00
parent 63e5b8058a
commit 5c12464db9
No known key found for this signature in database
GPG key ID: 3155C8B2F0428C81
2 changed files with 4 additions and 6 deletions

View file

@ -68,6 +68,8 @@ const NUMBER_OF_FRAMES_TO_MEASURE = 20;
const SHOULD_PROMPT_FOR_PROFILE_MIGRATION_KEY = 'terminals.integrated.profile-migration';
let migrationMessageShown = false;
const enum Constants {
/**
* The maximum amount of milliseconds to wait for a container before starting to create the
@ -227,7 +229,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
get onRequestAddInstanceToGroup(): Event<IRequestAddInstanceToGroupEvent> { return this._onRequestAddInstanceToGroup.event; }
constructor(
private readonly _messageShown: boolean,
private readonly _terminalFocusContextKey: IContextKey<boolean>,
private readonly _terminalShellTypeContextKey: IContextKey<string>,
private readonly _terminalAltBufferActiveContextKey: IContextKey<boolean>,
@ -361,7 +362,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
const shouldMigrateToProfile = (!!this._configurationService.getValue(TerminalSettingPrefix.Shell + platform) ||
!!this._configurationService.inspect(TerminalSettingPrefix.ShellArgs + platform).userValue) &&
!!this._configurationService.getValue(TerminalSettingPrefix.DefaultProfile + platform);
if (shouldMigrateToProfile && this._storageService.getBoolean(SHOULD_PROMPT_FOR_PROFILE_MIGRATION_KEY, StorageScope.WORKSPACE, true) && !this._messageShown) {
if (shouldMigrateToProfile && this._storageService.getBoolean(SHOULD_PROMPT_FOR_PROFILE_MIGRATION_KEY, StorageScope.WORKSPACE, true) && !migrationMessageShown) {
this._notificationService.prompt(
Severity.Info,
nls.localize('terminalProfileMigration', "The terminal is using deprecated shell/shellArgs settings, do you want to migrate it to a profile?"),
@ -395,6 +396,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
neverShowAgain: { id: SHOULD_PROMPT_FOR_PROFILE_MIGRATION_KEY, scope: NeverShowAgainScope.WORKSPACE }
}
);
migrationMessageShown = true;
}
}

View file

@ -91,8 +91,6 @@ export class TerminalService implements ITerminalService {
return this._terminalInstances;
}
private _messageShown: boolean = false;
private readonly _onActiveGroupChanged = new Emitter<void>();
get onActiveGroupChanged(): Event<void> { return this._onActiveGroupChanged.event; }
private readonly _onInstanceCreated = new Emitter<ITerminalInstance>();
@ -1077,14 +1075,12 @@ export class TerminalService implements ITerminalService {
createInstance(shellLaunchConfig: IShellLaunchConfig): ITerminalInstance {
const instance = this._instantiationService.createInstance(TerminalInstance,
this._messageShown,
this._terminalFocusContextKey,
this._terminalShellTypeContextKey,
this._terminalAltBufferActiveContextKey,
this._configHelper,
shellLaunchConfig
);
this._messageShown = true;
this._onInstanceCreated.fire(instance);
return instance;
}