@@ -134,10 +134,10 @@ export class TerminalService implements ITerminalService {
134134 get onDidChangeInstances ( ) : Event < void > { return this . _onDidChangeInstances . event ; }
135135 private readonly _onDidChangeInstanceTitle = new Emitter < ITerminalInstance | undefined > ( ) ;
136136 get onDidChangeInstanceTitle ( ) : Event < ITerminalInstance | undefined > { return this . _onDidChangeInstanceTitle . event ; }
137- private readonly _onDidChangeInstanceIcon = new Emitter < ITerminalInstance | undefined > ( ) ;
138- get onDidChangeInstanceIcon ( ) : Event < ITerminalInstance | undefined > { return this . _onDidChangeInstanceIcon . event ; }
139- private readonly _onDidChangeInstanceColor = new Emitter < ITerminalInstance | undefined > ( ) ;
140- get onDidChangeInstanceColor ( ) : Event < ITerminalInstance | undefined > { return this . _onDidChangeInstanceColor . event ; }
137+ private readonly _onDidChangeInstanceIcon = new Emitter < { instance : ITerminalInstance ; userInitiated : boolean } > ( ) ;
138+ get onDidChangeInstanceIcon ( ) : Event < { instance : ITerminalInstance ; userInitiated : boolean } > { return this . _onDidChangeInstanceIcon . event ; }
139+ private readonly _onDidChangeInstanceColor = new Emitter < { instance : ITerminalInstance ; userInitiated : boolean } > ( ) ;
140+ get onDidChangeInstanceColor ( ) : Event < { instance : ITerminalInstance ; userInitiated : boolean } > { return this . _onDidChangeInstanceColor . event ; }
141141 private readonly _onDidChangeActiveInstance = new Emitter < ITerminalInstance | undefined > ( ) ;
142142 get onDidChangeActiveInstance ( ) : Event < ITerminalInstance | undefined > { return this . _onDidChangeActiveInstance . event ; }
143143 private readonly _onDidChangeInstancePrimaryStatus = new Emitter < ITerminalInstance > ( ) ;
@@ -501,7 +501,7 @@ export class TerminalService implements ITerminalService {
501501 // terminal ID will be stale and the process will be leaked.
502502 this . onDidReceiveProcessId ( ( ) => this . _saveState ( ) ) ;
503503 this . onDidChangeInstanceTitle ( instance => this . _updateTitle ( instance ) ) ;
504- this . onDidChangeInstanceIcon ( instance => this . _updateIcon ( instance ) ) ;
504+ this . onDidChangeInstanceIcon ( e => this . _updateIcon ( e . instance , e . userInitiated ) ) ;
505505 }
506506
507507 private _handleInstanceContextKeys ( ) : void {
@@ -676,7 +676,7 @@ export class TerminalService implements ITerminalService {
676676 }
677677
678678 @debounce ( 500 )
679- private _updateTitle ( instance ? : ITerminalInstance ) : void {
679+ private _updateTitle ( instance : ITerminalInstance | undefined ) : void {
680680 if ( ! this . configHelper . config . enablePersistentSessions || ! instance || ! instance . persistentProcessId || ! instance . title || instance . isDisposed ) {
681681 return ;
682682 }
@@ -688,11 +688,11 @@ export class TerminalService implements ITerminalService {
688688 }
689689
690690 @debounce ( 500 )
691- private _updateIcon ( instance ? : ITerminalInstance ) : void {
691+ private _updateIcon ( instance : ITerminalInstance , userInitiated : boolean ) : void {
692692 if ( ! this . configHelper . config . enablePersistentSessions || ! instance || ! instance . persistentProcessId || ! instance . icon || instance . isDisposed ) {
693693 return ;
694694 }
695- this . _primaryBackend ?. updateIcon ( instance . persistentProcessId , instance . icon , instance . color ) ;
695+ this . _primaryBackend ?. updateIcon ( instance . persistentProcessId , userInitiated , instance . icon , instance . color ) ;
696696 }
697697
698698 refreshActiveGroup ( ) : void {
0 commit comments