mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-01 20:03:17 +01:00
Fix: Replace terminal view lifecycle hack with Event.once
This commit is contained in:
@@ -337,10 +337,8 @@ export class TerminalViewPane extends ViewPane {
|
||||
// be focused. So wait for connection to finish, then focus.
|
||||
const previousActiveElement = this.element.ownerDocument.activeElement;
|
||||
if (previousActiveElement) {
|
||||
// TODO: Improve lifecycle management this event should be disposed after first fire
|
||||
this._register(this._terminalService.onDidChangeConnectionState(() => {
|
||||
this._register(Event.once(this._terminalService.onDidChangeConnectionState)(() => {
|
||||
// Only focus the terminal if the activeElement has not changed since focus() was called
|
||||
// TODO: Hack
|
||||
if (previousActiveElement && dom.isActiveElement(previousActiveElement)) {
|
||||
this._terminalGroupService.showPanel(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user