Activation event, register api

This commit is contained in:
Daniel Imms
2021-05-26 07:41:16 -07:00
parent 789a91a487
commit e29194ad0d
7 changed files with 114 additions and 13 deletions

View File

@@ -33,6 +33,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
private _extHostTerminalIds = new Map<string, number>();
private readonly _toDispose = new DisposableStore();
private readonly _terminalProcessProxies = new Map<number, ITerminalProcessExtHostProxy>();
private readonly _profileProviders = new Map<string, IDisposable>();
private _dataEventTracker: TerminalDataEventTracker | undefined;
/**
* A single shared terminal link provider for the exthost. When an ext registers a link
@@ -200,6 +201,21 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this._terminalService.registerProcessSupport(isSupported);
}
public $registerProfileProvider(id: string): void {
// Proxy profile provider requests through the extension host
this._profileProviders.set(id, this._terminalService.registerTerminalProfileProvider(id, {
provideProfile: async () => {
console.log('provide profile', id);
return { name: 'My fake profile' };
}
}));
}
public $unregisterProfileProvider(id: string): void {
this._profileProviders.get(id)?.dispose();
this._profileProviders.delete(id);
}
private _onActiveTerminalChanged(terminalId: number | null): void {
this._proxy.$acceptActiveTerminalChanged(terminalId);
}