Skip to content

Commit

Permalink
fix #109765.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Nov 11, 2020
1 parent 97664e1 commit 0ef0d2d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,11 @@ export interface ITerminalInstance {
*/
notifyFindWidgetFocusChanged(isFocused: boolean): void;

/**
* Notifies the terminal to refresh its focus state based on the active document elemnet in DOM
*/
refreshFocusState(): void;

/**
* Focuses the terminal instance if it's able to (xterm.js instance exists).
*
Expand Down
4 changes: 4 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,10 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
this._terminalFocusContextKey.set(terminalFocused);
}

public refreshFocusState() {
this.notifyFindWidgetFocusChanged(false);
}

public dispose(immediate?: boolean): void {
this._logService.trace(`terminalInstance#dispose (id: ${this.id})`);

Expand Down
3 changes: 3 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/terminalView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ export class TerminalViewPane extends ViewPane {
}
} else {
this._terminalService.getActiveTab()?.setVisible(false);
this._terminalService.terminalInstances.forEach(instance => {
instance.notifyFindWidgetFocusChanged(false);
});
}
}));

Expand Down

0 comments on commit 0ef0d2d

Please sign in to comment.