File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,6 @@ export class MainThreadTerminalShellIntegration extends Disposable implements Ma
114
114
115
115
private _enableShellIntegration ( instance : ITerminalInstance ) : void {
116
116
this . _extensionService . activateByEvent ( 'onTerminalShellIntegration:*' ) ;
117
- this . _register ( instance . onDidChangeShellType ( ( ) => this . _extensionService . activateByEvent ( `onTerminalShellIntegration:${ instance . shellType } ` ) ) ) ;
118
117
if ( instance . shellType ) {
119
118
this . _extensionService . activateByEvent ( `onTerminalShellIntegration:${ instance . shellType } ` ) ;
120
119
}
Original file line number Diff line number Diff line change @@ -846,6 +846,12 @@ export class TerminalService extends Disposable implements ITerminalService {
846
846
} ) ) ;
847
847
instanceDisposables . add ( instance . onDidFocus ( this . _onDidChangeActiveInstance . fire , this . _onDidChangeActiveInstance ) ) ;
848
848
instanceDisposables . add ( instance . onRequestAddInstanceToGroup ( async e => await this . _addInstanceToGroup ( instance , e ) ) ) ;
849
+ instanceDisposables . add ( instance . onDidChangeShellType ( ( ) => this . _extensionService . activateByEvent ( `onTerminal:${ instance . shellType } ` ) ) ) ;
850
+ instanceDisposables . add ( Event . runAndSubscribe ( instance . capabilities . onDidAddCapability , ( ( ) => {
851
+ if ( instance . capabilities . has ( TerminalCapability . CommandDetection ) ) {
852
+ this . _extensionService . activateByEvent ( `onTerminalShellIntegration:${ instance . shellType } ` ) ;
853
+ }
854
+ } ) ) ) ;
849
855
const disposeListener = this . _register ( instance . onDisposed ( ( ) => {
850
856
instanceDisposables . dispose ( ) ;
851
857
this . _store . delete ( disposeListener ) ;
@@ -1024,7 +1030,6 @@ export class TerminalService extends Disposable implements ITerminalService {
1024
1030
} else {
1025
1031
instance = this . _createTerminal ( shellLaunchConfig , location , options ) ;
1026
1032
}
1027
- this . _register ( instance . onDidChangeShellType ( ( ) => this . _extensionService . activateByEvent ( `onTerminal:${ instance . shellType } ` ) ) ) ;
1028
1033
if ( instance . shellType ) {
1029
1034
this . _extensionService . activateByEvent ( `onTerminal:${ instance . shellType } ` ) ;
1030
1035
}
You can’t perform that action at this time.
0 commit comments