externalTerminal renderer -> main process (#122871)

This commit is contained in:
Megan Rogge
2021-05-03 21:18:34 -05:00
committed by GitHub
parent f19a2c969b
commit de4e9067e8
14 changed files with 208 additions and 316 deletions

View File

@@ -87,6 +87,8 @@ import { ExtensionUrlTrustService } from 'vs/platform/extensionManagement/node/e
import { once } from 'vs/base/common/functional';
import { getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts';
import { ISignService } from 'vs/platform/sign/common/sign';
import { IExternalTerminalMainService } from 'vs/platform/externalTerminal/common/externalTerminal';
import { LinuxExternalTerminalService, MacExternalTerminalService, WindowsExternalTerminalService } from 'vs/platform/externalTerminal/node/externalTerminalService';
/**
* The main VS Code application. There will only ever be one instance,
@@ -551,6 +553,15 @@ export class CodeApplication extends Disposable {
// Storage
services.set(IStorageMainService, new SyncDescriptor(StorageMainService));
// External terminal
if (isWindows) {
services.set(IExternalTerminalMainService, new SyncDescriptor(WindowsExternalTerminalService));
} else if (isMacintosh) {
services.set(IExternalTerminalMainService, new SyncDescriptor(MacExternalTerminalService));
} else if (isLinux) {
services.set(IExternalTerminalMainService, new SyncDescriptor(LinuxExternalTerminalService));
}
// Backups
const backupMainService = new BackupMainService(this.environmentMainService, this.configurationService, this.logService);
services.set(IBackupMainService, backupMainService);
@@ -637,6 +648,10 @@ export class CodeApplication extends Disposable {
mainProcessElectronServer.registerChannel('storage', storageChannel);
sharedProcessClient.then(client => client.registerChannel('storage', storageChannel));
// External Terminal
const externalTerminalChannel = ProxyChannel.fromService(accessor.get(IExternalTerminalMainService));
mainProcessElectronServer.registerChannel('externalTerminal', externalTerminalChannel);
// Log Level (main & shared process)
const logLevelChannel = new LogLevelChannel(accessor.get(ILogService));
mainProcessElectronServer.registerChannel('logLevel', logLevelChannel);