mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
parent
78c2a0fa4c
commit
4ae99d1027
|
@ -63,7 +63,7 @@ export class TerminalService implements ITerminalService {
|
|||
private _linkProviderDisposables: Map<ITerminalExternalLinkProvider, IDisposable[]> = new Map();
|
||||
private _processSupportContextKey: IContextKey<boolean>;
|
||||
private readonly _localTerminalService?: ILocalTerminalService;
|
||||
private readonly _offProcessTerminalService?: IOffProcessTerminalService;
|
||||
private readonly _primaryOffProcessTerminalService?: IOffProcessTerminalService;
|
||||
private _profilesReadyBarrier: AutoOpenBarrier;
|
||||
private _availableProfiles: ITerminalProfile[] | undefined;
|
||||
private _configHelper: TerminalConfigHelper;
|
||||
|
@ -210,7 +210,7 @@ export class TerminalService implements ITerminalService {
|
|||
: enableTerminalReconnection
|
||||
? this._localTerminalsInitPromise = this._reconnectToLocalTerminals()
|
||||
: Promise.resolve();
|
||||
this._offProcessTerminalService = !!this._environmentService.remoteAuthority ? this._remoteTerminalService : this._localTerminalService;
|
||||
this._primaryOffProcessTerminalService = !!this._environmentService.remoteAuthority ? this._remoteTerminalService : this._localTerminalService;
|
||||
initPromise.then(() => this._setConnected());
|
||||
|
||||
// Wait up to 5 seconds for profiles to be ready so it's assured that we know the actual
|
||||
|
@ -376,12 +376,11 @@ export class TerminalService implements ITerminalService {
|
|||
}
|
||||
|
||||
private async _detectProfiles(includeDetectedProfiles?: boolean): Promise<ITerminalProfile[]> {
|
||||
const offProcService = this._offProcessTerminalService;
|
||||
if (!offProcService) {
|
||||
if (!this._primaryOffProcessTerminalService) {
|
||||
return this._availableProfiles || [];
|
||||
}
|
||||
const platform = await this._getPlatformKey();
|
||||
return offProcService?.getProfiles(this._configurationService.getValue(`${TerminalSettingPrefix.Profiles}${platform}`), this._configurationService.getValue(`${TerminalSettingPrefix.DefaultProfile}${platform}`), includeDetectedProfiles);
|
||||
return this._primaryOffProcessTerminalService?.getProfiles(this._configurationService.getValue(`${TerminalSettingPrefix.Profiles}${platform}`), this._configurationService.getValue(`${TerminalSettingPrefix.DefaultProfile}${platform}`), includeDetectedProfiles);
|
||||
}
|
||||
|
||||
private _onBeforeShutdown(reason: ShutdownReason): boolean | Promise<boolean> {
|
||||
|
@ -441,7 +440,7 @@ export class TerminalService implements ITerminalService {
|
|||
const state: ITerminalsLayoutInfoById = {
|
||||
tabs: this.terminalGroups.map(g => g.getLayoutInfo(g === this.getActiveGroup()))
|
||||
};
|
||||
this._offProcessTerminalService?.setTerminalLayoutInfo(state);
|
||||
this._primaryOffProcessTerminalService?.setTerminalLayoutInfo(state);
|
||||
}
|
||||
|
||||
@debounce(500)
|
||||
|
@ -449,7 +448,7 @@ export class TerminalService implements ITerminalService {
|
|||
if (!this.configHelper.config.enablePersistentSessions || !instance || !instance.persistentProcessId || !instance.title) {
|
||||
return;
|
||||
}
|
||||
this._offProcessTerminalService?.updateTitle(instance.persistentProcessId, instance.title, instance.titleSource);
|
||||
this._primaryOffProcessTerminalService?.updateTitle(instance.persistentProcessId, instance.title, instance.titleSource);
|
||||
}
|
||||
|
||||
@debounce(500)
|
||||
|
@ -457,7 +456,7 @@ export class TerminalService implements ITerminalService {
|
|||
if (!this.configHelper.config.enablePersistentSessions || !instance || !instance.persistentProcessId || !instance.icon) {
|
||||
return;
|
||||
}
|
||||
this._offProcessTerminalService?.updateIcon(instance.persistentProcessId, instance.icon, instance.color);
|
||||
this._primaryOffProcessTerminalService?.updateIcon(instance.persistentProcessId, instance.icon, instance.color);
|
||||
}
|
||||
|
||||
private _removeGroup(group: ITerminalGroup): void {
|
||||
|
|
Loading…
Reference in a new issue