Skip to content

Commit

Permalink
on move of terminal from or to the panel, hide find widget (#146568)
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge authored Apr 1, 2022
1 parent f919f6c commit 86cc884
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/terminal/browser/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export interface ITerminalService extends ITerminalInstanceHost {
onDidInputInstanceData: Event<ITerminalInstance>;
onDidRegisterProcessSupport: Event<void>;
onDidChangeConnectionState: Event<void>;
onDidRequestHideFindWidget: Event<void>;

/**
* Creates a terminal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class TerminalEditor extends EditorPane {
this._findWidget = instantiationService.createInstance(TerminalFindWidget, this._findState);
this._dropdownMenu = this._register(menuService.createMenu(MenuId.TerminalNewDropdownContext, _contextKeyService));
this._instanceMenu = this._register(menuService.createMenu(MenuId.TerminalEditorInstanceContext, _contextKeyService));
this._register(this._terminalService.onDidRequestHideFindWidget(() => this.hideFindWidget()));
}

override async setInput(newInput: TerminalEditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken) {
Expand Down
4 changes: 4 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/terminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ export class TerminalService implements ITerminalService {
get onDidRegisterProcessSupport(): Event<void> { return this._onDidRegisterProcessSupport.event; }
private readonly _onDidChangeConnectionState = new Emitter<void>();
get onDidChangeConnectionState(): Event<void> { return this._onDidChangeConnectionState.event; }
private readonly _onDidRequestHideFindWidget = new Emitter<void>();
get onDidRequestHideFindWidget(): Event<void> { return this._onDidRequestHideFindWidget.event; }

constructor(
@IContextKeyService private _contextKeyService: IContextKeyService,
Expand Down Expand Up @@ -720,6 +722,7 @@ export class TerminalService implements ITerminalService {
}
sourceGroup.removeInstance(source);
this._terminalEditorService.openEditor(source);
this._onDidRequestHideFindWidget.fire();
}

async moveToTerminalView(source?: ITerminalInstance, target?: ITerminalInstance, side?: 'before' | 'after'): Promise<void> {
Expand Down Expand Up @@ -766,6 +769,7 @@ export class TerminalService implements ITerminalService {
this._onDidChangeInstances.fire();
this._onDidChangeActiveGroup.fire(this._terminalGroupService.activeGroup);
this._terminalGroupService.showPanel(true);
this._onDidRequestHideFindWidget.fire();
}

protected _initInstanceListeners(instance: ITerminalInstance): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class TerminalTabbedView extends Disposable {
this._register(this._terminalGroupService.onDidChangeInstances(() => this._refreshShowTabs()));
this._register(this._terminalGroupService.onDidChangeGroups(() => this._refreshShowTabs()));
this._register(this._themeService.onDidColorThemeChange(theme => this._updateTheme(theme)));
this._register(this._terminalService.onDidRequestHideFindWidget(() => this.hideFindWidget()));
this._updateTheme();

this._findWidget.focusTracker.onDidFocus(() => this._terminalContainer.classList.add(CssClass.FindFocus));
Expand Down

0 comments on commit 86cc884

Please sign in to comment.