@@ -10,7 +10,7 @@ import {
1010 terminals ,
1111 withProgress ,
1212} from '../../common/window.apis' ;
13- import { getConfiguration } from '../../common/workspace.apis' ;
13+ import { getConfiguration , onDidChangeConfiguration } from '../../common/workspace.apis' ;
1414import { isActivatableEnvironment } from '../common/activation' ;
1515import { identifyTerminalShell } from '../common/shellDetector' ;
1616import { getPythonApi } from '../pythonApi' ;
@@ -102,6 +102,23 @@ export class TerminalManagerImpl implements TerminalManager {
102102 this . ta . onDidChangeTerminalActivationState ( ( e ) => {
103103 this . onDidChangeTerminalActivationStateEmitter . fire ( e ) ;
104104 } ) ,
105+ onDidChangeConfiguration ( async ( e ) => {
106+ if ( e . affectsConfiguration ( 'python-envs.terminal.autoActivationType' ) ) {
107+ const actType = getAutoActivationType ( ) ;
108+ if ( actType === 'shellStartup' ) {
109+ traceInfo ( `Auto activation type changed to ${ actType } ` ) ;
110+ const shells = new Set (
111+ terminals ( )
112+ . map ( ( t ) => identifyTerminalShell ( t ) )
113+ . filter ( ( t ) => t !== 'unknown' ) ,
114+ ) ;
115+ await handleSettingUpShellProfileMultiple (
116+ this . startupScriptProviders . filter ( ( p ) => shells . has ( p . shellType ) ) ,
117+ ( p , v ) => this . shellSetup . set ( p . shellType , v ) ,
118+ ) ;
119+ }
120+ }
121+ } ) ,
105122 ) ;
106123 }
107124
0 commit comments