File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
src/vs/workbench/contrib/terminal/browser Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -592,13 +592,12 @@ export class TerminalTabbedView extends Disposable {
592592 // be focused. So wait for connection to finish, then focus.
593593 const previousActiveElement = this . _tabListElement . ownerDocument . activeElement ;
594594 if ( previousActiveElement ) {
595- // TODO: Improve lifecycle management this event should be disposed after first fire
596- this . _register ( this . _terminalService . onDidChangeConnectionState ( ( ) => {
595+ const listener = this . _register ( Event . once ( this . _terminalService . onDidChangeConnectionState ) ( ( ) => {
597596 // Only focus the terminal if the activeElement has not changed since focus() was called
598- // TODO: Hack
599597 if ( dom . isActiveElement ( previousActiveElement ) ) {
600598 this . _focus ( ) ;
601599 }
600+ this . _store . delete ( listener ) ;
602601 } ) ) ;
603602 }
604603 }
You can’t perform that action at this time.
0 commit comments