diff --git a/src/vs/workbench/api/browser/mainThreadTerminalService.ts b/src/vs/workbench/api/browser/mainThreadTerminalService.ts index 04c89cddda0..58d9bbe5660 100644 --- a/src/vs/workbench/api/browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/browser/mainThreadTerminalService.ts @@ -65,12 +65,12 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape })); this._toDispose.add(_terminalService.onDidDisposeInstance(instance => this._onTerminalDisposed(instance))); - this._toDispose.add(_terminalService.onInstanceProcessIdReady(instance => this._onTerminalProcessIdReady(instance))); - this._toDispose.add(_terminalService.onInstanceDimensionsChanged(instance => this._onInstanceDimensionsChanged(instance))); - this._toDispose.add(_terminalService.onInstanceMaximumDimensionsChanged(instance => this._onInstanceMaximumDimensionsChanged(instance))); - this._toDispose.add(_terminalService.onInstanceRequestStartExtensionTerminal(e => this._onRequestStartExtensionTerminal(e))); + this._toDispose.add(_terminalService.onDidReceiveProcessId(instance => this._onTerminalProcessIdReady(instance))); + this._toDispose.add(_terminalService.onDidChangeInstanceDimensions(instance => this._onInstanceDimensionsChanged(instance))); + this._toDispose.add(_terminalService.onDidMaximumDimensionsChange(instance => this._onInstanceMaximumDimensionsChanged(instance))); + this._toDispose.add(_terminalService.onDidRequestStartExtensionTerminal(e => this._onRequestStartExtensionTerminal(e))); this._toDispose.add(_terminalService.onDidChangeActiveInstance(instance => this._onActiveTerminalChanged(instance ? instance.instanceId : null))); - this._toDispose.add(_terminalService.onInstanceTitleChanged(instance => instance && this._onTitleChanged(instance.instanceId, instance.title))); + this._toDispose.add(_terminalService.onDidChangeInstanceTitle(instance => instance && this._onTitleChanged(instance.instanceId, instance.title))); // Set initial ext host state this._terminalService.instances.forEach(t => { diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.ts b/src/vs/workbench/contrib/terminal/browser/terminal.ts index 74892f6d7f1..e7e322e0024 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.ts @@ -111,17 +111,17 @@ export interface ITerminalService extends ITerminalInstanceHost { readonly profilesReady: Promise; initializeTerminals(): Promise; - onActiveGroupChanged: Event; - onGroupDisposed: Event; + onDidChangeActiveGroup: Event; + onDidDisposeGroup: Event; onDidCreateInstance: Event; - onInstanceProcessIdReady: Event; - onInstanceDimensionsChanged: Event; - onInstanceMaximumDimensionsChanged: Event; - onInstanceRequestStartExtensionTerminal: Event; - onInstanceTitleChanged: Event; - onInstanceIconChanged: Event; - onInstanceColorChanged: Event; - onInstancePrimaryStatusChanged: Event; + onDidReceiveProcessId: Event; + onDidChangeInstanceDimensions: Event; + onDidMaximumDimensionsChange: Event; + onDidRequestStartExtensionTerminal: Event; + onDidChangeInstanceTitle: Event; + onDidChangeInstanceIcon: Event; + onDidChangeInstanceColor: Event; + onDidChangeInstancePrimaryStatus: Event; onDidRegisterProcessSupport: Event; onDidChangeConnectionState: Event; onDidChangeAvailableProfiles: Event; @@ -221,7 +221,7 @@ export interface ITerminalGroupService extends ITerminalInstanceHost, ITerminalF /** Fires when a group is created, disposed of, or shown (in the case of a background group). */ readonly onDidChangeGroups: Event; - readonly onPanelOrientationChanged: Event; + readonly onDidChangePanelOrientation: Event; createGroup(shellLaunchConfig?: IShellLaunchConfig): ITerminalGroup; createGroup(instance?: ITerminalInstance): ITerminalGroup; diff --git a/src/vs/workbench/contrib/terminal/browser/terminalDecorationsProvider.ts b/src/vs/workbench/contrib/terminal/browser/terminalDecorationsProvider.ts index 15fc6fd02b4..34c473fb1e1 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalDecorationsProvider.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalDecorationsProvider.ts @@ -24,7 +24,7 @@ export class TerminalDecorationsProvider implements IDecorationsProvider { constructor( @ITerminalService private readonly _terminalService: ITerminalService ) { - this._terminalService.onInstancePrimaryStatusChanged(e => this._onDidChange.fire([e.resource])); + this._terminalService.onDidChangeInstancePrimaryStatus(e => this._onDidChange.fire([e.resource])); } get onDidChange(): Event { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts b/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts index 714d7588d97..a81f1cc7cf4 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts @@ -51,8 +51,8 @@ export class TerminalGroupService extends Disposable implements ITerminalGroupSe private readonly _onDidChangeInstances = new Emitter(); readonly onDidChangeInstances = this._onDidChangeInstances.event; - private readonly _onPanelOrientationChanged = new Emitter(); - readonly onPanelOrientationChanged = this._onPanelOrientationChanged.event; + private readonly _onDidChangePanelOrientation = new Emitter(); + readonly onDidChangePanelOrientation = this._onDidChangePanelOrientation.event; constructor( @IContextKeyService private _contextKeyService: IContextKeyService, @@ -139,7 +139,7 @@ export class TerminalGroupService extends Disposable implements ITerminalGroupSe createGroup(slcOrInstance?: IShellLaunchConfig | ITerminalInstance): ITerminalGroup { const group = this._instantiationService.createInstance(TerminalGroup, this._container, slcOrInstance); // TODO: Move panel orientation change into this file so it's not fired many times - group.onPanelOrientationChanged((orientation) => this._onPanelOrientationChanged.fire(orientation)); + group.onPanelOrientationChanged((orientation) => this._onDidChangePanelOrientation.fire(orientation)); this.groups.push(group); group.addDisposable(group.onDidDisposeInstance(this._onDidDisposeInstance.fire, this._onDidDisposeInstance)); group.addDisposable(group.onDidFocusInstance(this._onDidFocusInstance.fire, this._onDidFocusInstance)); diff --git a/src/vs/workbench/contrib/terminal/browser/terminalService.ts b/src/vs/workbench/contrib/terminal/browser/terminalService.ts index 43cc739874b..6961bfa0c1d 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalService.ts @@ -86,40 +86,40 @@ export class TerminalService implements ITerminalService { private _activeInstance: ITerminalInstance | undefined; get activeInstance(): ITerminalInstance | undefined { return this._activeInstance; } - private readonly _onActiveGroupChanged = new Emitter(); - get onActiveGroupChanged(): Event { return this._onActiveGroupChanged.event; } + private readonly _onDidChangeActiveGroup = new Emitter(); + get onDidChangeActiveGroup(): Event { return this._onDidChangeActiveGroup.event; } private readonly _onDidCreateInstance = new Emitter(); get onDidCreateInstance(): Event { return this._onDidCreateInstance.event; } private readonly _onDidDisposeInstance = new Emitter(); get onDidDisposeInstance(): Event { return this._onDidDisposeInstance.event; } private readonly _onDidFocusInstance = new Emitter(); get onDidFocusInstance(): Event { return this._onDidFocusInstance.event; } - private readonly _onInstanceProcessIdReady = new Emitter(); - get onInstanceProcessIdReady(): Event { return this._onInstanceProcessIdReady.event; } - private readonly _onInstanceLinksReady = new Emitter(); - get onInstanceLinksReady(): Event { return this._onInstanceLinksReady.event; } - private readonly _onInstanceRequestStartExtensionTerminal = new Emitter(); - get onInstanceRequestStartExtensionTerminal(): Event { return this._onInstanceRequestStartExtensionTerminal.event; } - private readonly _onInstanceDimensionsChanged = new Emitter(); - get onInstanceDimensionsChanged(): Event { return this._onInstanceDimensionsChanged.event; } - private readonly _onInstanceMaximumDimensionsChanged = new Emitter(); - get onInstanceMaximumDimensionsChanged(): Event { return this._onInstanceMaximumDimensionsChanged.event; } + private readonly _onDidReceiveProcessId = new Emitter(); + get onDidReceiveProcessId(): Event { return this._onDidReceiveProcessId.event; } + private readonly _onDidReceiveInstanceLinks = new Emitter(); + get onDidReceiveInstanceLinks(): Event { return this._onDidReceiveInstanceLinks.event; } + private readonly _onDidRequestStartExtensionTerminal = new Emitter(); + get onDidRequestStartExtensionTerminal(): Event { return this._onDidRequestStartExtensionTerminal.event; } + private readonly _onDidChangeInstanceDimensions = new Emitter(); + get onDidChangeInstanceDimensions(): Event { return this._onDidChangeInstanceDimensions.event; } + private readonly _onDidMaxiumumDimensionsChange = new Emitter(); + get onDidMaximumDimensionsChange(): Event { return this._onDidMaxiumumDimensionsChange.event; } private readonly _onDidChangeInstances = new Emitter(); get onDidChangeInstances(): Event { return this._onDidChangeInstances.event; } - private readonly _onInstanceTitleChanged = new Emitter(); - get onInstanceTitleChanged(): Event { return this._onInstanceTitleChanged.event; } - private readonly _onInstanceIconChanged = new Emitter(); - get onInstanceIconChanged(): Event { return this._onInstanceIconChanged.event; } - private readonly _onInstanceColorChanged = new Emitter(); - get onInstanceColorChanged(): Event { return this._onInstanceColorChanged.event; } + private readonly _onDidChangeInstanceTitle = new Emitter(); + get onDidChangeInstanceTitle(): Event { return this._onDidChangeInstanceTitle.event; } + private readonly _onDidChangeInstanceIcon = new Emitter(); + get onDidChangeInstanceIcon(): Event { return this._onDidChangeInstanceIcon.event; } + private readonly _onDidChangeInstanceColor = new Emitter(); + get onDidChangeInstanceColor(): Event { return this._onDidChangeInstanceColor.event; } private readonly _onDidChangeActiveInstance = new Emitter(); get onDidChangeActiveInstance(): Event { return this._onDidChangeActiveInstance.event; } - private readonly _onInstancePrimaryStatusChanged = new Emitter(); - get onInstancePrimaryStatusChanged(): Event { return this._onInstancePrimaryStatusChanged.event; } - private readonly _onGroupDisposed = new Emitter(); - get onGroupDisposed(): Event { return this._onGroupDisposed.event; } - private readonly _onGroupsChanged = new Emitter(); - get onGroupsChanged(): Event { return this._onGroupsChanged.event; } + private readonly _onDidChangeInstancePrimaryStatus = new Emitter(); + get onDidChangeInstancePrimaryStatus(): Event { return this._onDidChangeInstancePrimaryStatus.event; } + private readonly _onDidDisposeGroup = new Emitter(); + get onDidDisposeGroup(): Event { return this._onDidDisposeGroup.event; } + private readonly _onDidChangeGroups = new Emitter(); + get onDidChangeGroups(): Event { return this._onDidChangeGroups.event; } private readonly _onDidRegisterProcessSupport = new Emitter(); get onDidRegisterProcessSupport(): Event { return this._onDidRegisterProcessSupport.event; } private readonly _onDidChangeConnectionState = new Emitter(); @@ -189,7 +189,7 @@ export class TerminalService implements ITerminalService { this._forwardInstanceHostEvents(this._terminalGroupService); this._forwardInstanceHostEvents(this._terminalEditorService); - this._terminalGroupService.onDidChangeActiveGroup(this._onActiveGroupChanged.fire, this._onActiveGroupChanged); + this._terminalGroupService.onDidChangeActiveGroup(this._onDidChangeActiveGroup.fire, this._onDidChangeActiveGroup); _terminalInstanceService.onDidCreateInstance(instance => { this._initInstanceListeners(instance); this._onDidCreateInstance.fire(instance); @@ -199,7 +199,7 @@ export class TerminalService implements ITerminalService { // we update detected profiles when an instance is created so that, // for example, we detect if you've installed a pwsh this.onDidCreateInstance(() => this._refreshAvailableProfiles()); - this.onInstanceLinksReady(instance => this._setInstanceLinkProviders(instance)); + this.onDidReceiveInstanceLinks(instance => this._setInstanceLinkProviders(instance)); // Hide the panel if there are no more instances, provided that VS Code is not shutting // down. When shutting down the panel is locked in place so that it is restored upon next @@ -389,14 +389,14 @@ export class TerminalService implements ITerminalService { } private _attachProcessLayoutListeners(): void { - this.onActiveGroupChanged(() => this._saveState()); + this.onDidChangeActiveGroup(() => this._saveState()); this.onDidChangeActiveInstance(() => this._saveState()); this.onDidChangeInstances(() => this._saveState()); // The state must be updated when the terminal is relaunched, otherwise the persistent // terminal ID will be stale and the process will be leaked. - this.onInstanceProcessIdReady(() => this._saveState()); - this.onInstanceTitleChanged(instance => this._updateTitle(instance)); - this.onInstanceIconChanged(instance => this._updateIcon(instance)); + this.onDidReceiveProcessId(() => this._saveState()); + this.onDidChangeInstanceTitle(instance => this._updateTitle(instance)); + this.onDidChangeInstanceIcon(instance => this._updateIcon(instance)); } private _handleInstanceContextKeys(): void { @@ -433,7 +433,7 @@ export class TerminalService implements ITerminalService { requestStartExtensionTerminal(proxy: ITerminalProcessExtHostProxy, cols: number, rows: number): Promise { // The initial request came from the extension host, no need to wait for it return new Promise(callback => { - this._onInstanceRequestStartExtensionTerminal.fire({ proxy, cols, rows, callback }); + this._onDidRequestStartExtensionTerminal.fire({ proxy, cols, rows, callback }); }); } @@ -535,7 +535,7 @@ export class TerminalService implements ITerminalService { } refreshActiveGroup(): void { - this._onActiveGroupChanged.fire(this._terminalGroupService.activeGroup); + this._onDidChangeActiveGroup.fire(this._terminalGroupService.activeGroup); } doWithActiveInstance(callback: (terminal: ITerminalInstance) => T): T | void { @@ -693,24 +693,24 @@ export class TerminalService implements ITerminalService { // Fire events this._onDidChangeInstances.fire(); - this._onActiveGroupChanged.fire(this._terminalGroupService.activeGroup); + this._onDidChangeActiveGroup.fire(this._terminalGroupService.activeGroup); this._terminalGroupService.showPanel(true); } protected _initInstanceListeners(instance: ITerminalInstance): void { - instance.addDisposable(instance.onTitleChanged(this._onInstanceTitleChanged.fire, this._onInstanceTitleChanged)); - instance.addDisposable(instance.onIconChanged(this._onInstanceIconChanged.fire, this._onInstanceIconChanged)); - instance.addDisposable(instance.onIconChanged(this._onInstanceColorChanged.fire, this._onInstanceColorChanged)); - instance.addDisposable(instance.onProcessIdReady(this._onInstanceProcessIdReady.fire, this._onInstanceProcessIdReady)); - instance.addDisposable(instance.statusList.onDidChangePrimaryStatus(() => this._onInstancePrimaryStatusChanged.fire(instance))); - instance.addDisposable(instance.onLinksReady(this._onInstanceLinksReady.fire, this._onInstanceLinksReady)); + instance.addDisposable(instance.onTitleChanged(this._onDidChangeInstanceTitle.fire, this._onDidChangeInstanceTitle)); + instance.addDisposable(instance.onIconChanged(this._onDidChangeInstanceIcon.fire, this._onDidChangeInstanceIcon)); + instance.addDisposable(instance.onIconChanged(this._onDidChangeInstanceColor.fire, this._onDidChangeInstanceColor)); + instance.addDisposable(instance.onProcessIdReady(this._onDidReceiveProcessId.fire, this._onDidReceiveProcessId)); + instance.addDisposable(instance.statusList.onDidChangePrimaryStatus(() => this._onDidChangeInstancePrimaryStatus.fire(instance))); + instance.addDisposable(instance.onLinksReady(this._onDidReceiveInstanceLinks.fire, this._onDidReceiveInstanceLinks)); instance.addDisposable(instance.onDimensionsChanged(() => { - this._onInstanceDimensionsChanged.fire(instance); + this._onDidChangeInstanceDimensions.fire(instance); if (this.configHelper.config.enablePersistentSessions && this.isProcessSupportRegistered) { this._saveState(); } })); - instance.addDisposable(instance.onMaximumDimensionsChanged(() => this._onInstanceMaximumDimensionsChanged.fire(instance))); + instance.addDisposable(instance.onMaximumDimensionsChanged(() => this._onDidMaxiumumDimensionsChange.fire(instance))); instance.addDisposable(instance.onFocus(this._onDidChangeActiveInstance.fire, this._onDidChangeActiveInstance)); instance.addDisposable(instance.onRequestAddInstanceToGroup(e => { const instanceId = this._getInstanceIdFromUri(e.uri); @@ -1087,7 +1087,7 @@ export class TerminalService implements ITerminalService { } this._onDidChangeInstances.fire(); - this._onGroupsChanged.fire(); + this._onDidChangeGroups.fire(); } async setContainers(panelContainer: HTMLElement, terminalContainer: HTMLElement): Promise { @@ -1117,8 +1117,8 @@ class TerminalEditorStyle extends Themable { } private _registerListeners(): void { - this._register(this._terminalService.onInstanceIconChanged(() => this.updateStyles())); - this._register(this._terminalService.onInstanceColorChanged(() => this.updateStyles())); + this._register(this._terminalService.onDidChangeInstanceIcon(() => this.updateStyles())); + this._register(this._terminalService.onDidChangeInstanceColor(() => this.updateStyles())); this._register(this._terminalService.onDidChangeInstances(() => this.updateStyles())); } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts b/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts index 102d4e6aef6..9c9ed9e5f95 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts @@ -138,7 +138,7 @@ export class TerminalTabbedView extends Disposable { this._attachEventListeners(parentElement, this._terminalContainer); - this._terminalGroupService.onPanelOrientationChanged((orientation) => { + this._terminalGroupService.onDidChangePanelOrientation((orientation) => { this._panelOrientation = orientation; }); diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTabsList.ts b/src/vs/workbench/contrib/terminal/browser/terminalTabsList.ts index 78e39277f31..128a79df652 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTabsList.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTabsList.ts @@ -101,9 +101,9 @@ export class TerminalTabList extends WorkbenchList { ); this._terminalGroupService.onDidChangeInstances(() => this.refresh()); this._terminalGroupService.onDidChangeGroups(() => this.refresh()); - this._terminalService.onInstanceTitleChanged(() => this.refresh()); - this._terminalService.onInstanceIconChanged(() => this.refresh()); - this._terminalService.onInstancePrimaryStatusChanged(() => this.refresh()); + this._terminalService.onDidChangeInstanceTitle(() => this.refresh()); + this._terminalService.onDidChangeInstanceIcon(() => this.refresh()); + this._terminalService.onDidChangeInstancePrimaryStatus(() => this.refresh()); this._terminalService.onDidChangeConnectionState(() => this.refresh()); this._themeService.onDidColorThemeChange(() => this.refresh()); this._terminalGroupService.onDidChangeActiveInstance(e => { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalView.ts b/src/vs/workbench/contrib/terminal/browser/terminalView.ts index 7dafd02f55e..32ba5c5cb25 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalView.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalView.ts @@ -359,9 +359,9 @@ class SwitchTerminalActionViewItem extends SelectActionViewItem { ) { super(null, action, getTerminalSelectOpenItems(_terminalService, _terminalGroupService), _terminalGroupService.activeGroupIndex, contextViewService, { ariaLabel: nls.localize('terminals', 'Open Terminals.'), optionsAsChildren: true }); this._register(_terminalService.onDidChangeInstances(() => this._updateItems(), this)); - this._register(_terminalService.onActiveGroupChanged(() => this._updateItems(), this)); + this._register(_terminalService.onDidChangeActiveGroup(() => this._updateItems(), this)); this._register(_terminalService.onDidChangeActiveInstance(() => this._updateItems(), this)); - this._register(_terminalService.onInstanceTitleChanged(() => this._updateItems(), this)); + this._register(_terminalService.onDidChangeInstanceTitle(() => this._updateItems(), this)); this._register(_terminalGroupService.onDidChangeGroups(() => this._updateItems(), this)); this._register(_terminalService.onDidChangeConnectionState(() => this._updateItems(), this)); this._register(_terminalService.onDidChangeAvailableProfiles(() => this._updateItems(), this)); @@ -433,11 +433,11 @@ class SingleTerminalTabActionViewItem extends MenuEntryActionViewItem { }, keybindingService, notificationService, contextKeyService); // Register listeners to update the tab - this._register(this._terminalService.onInstancePrimaryStatusChanged(e => this.updateLabel(e))); + this._register(this._terminalService.onDidChangeInstancePrimaryStatus(e => this.updateLabel(e))); this._register(this._terminalGroupService.onDidChangeActiveInstance(() => this.updateLabel())); - this._register(this._terminalService.onInstanceIconChanged(e => this.updateLabel(e))); - this._register(this._terminalService.onInstanceColorChanged(e => this.updateLabel(e))); - this._register(this._terminalService.onInstanceTitleChanged(e => { + this._register(this._terminalService.onDidChangeInstanceIcon(e => this.updateLabel(e))); + this._register(this._terminalService.onDidChangeInstanceColor(e => this.updateLabel(e))); + this._register(this._terminalService.onDidChangeInstanceTitle(e => { if (e === this._terminalGroupService.activeInstance) { this._action.tooltip = getSingleTabTooltip(e); this.updateLabel(); @@ -590,8 +590,8 @@ class TerminalThemeIconStyle extends Themable { } private _registerListeners(): void { - this._register(this._terminalService.onInstanceIconChanged(() => this.updateStyles())); - this._register(this._terminalService.onInstanceColorChanged(() => this.updateStyles())); + this._register(this._terminalService.onDidChangeInstanceIcon(() => this.updateStyles())); + this._register(this._terminalService.onDidChangeInstanceColor(() => this.updateStyles())); this._register(this._terminalService.onDidChangeInstances(() => this.updateStyles())); this._register(this._terminalGroupService.onDidChangeGroups(() => this.updateStyles())); }