Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on move of terminal from or to the panel, hide find widget #146568

Merged
merged 4 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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