@@ -32,7 +32,7 @@ import { defaultShells } from '../../interpreter/activation/service';
32
32
import { IEnvironmentActivationService } from '../../interpreter/activation/types' ;
33
33
import { EnvironmentType , PythonEnvironment } from '../../pythonEnvironments/info' ;
34
34
import { getSearchPathEnvVarNames } from '../../common/utils/exec' ;
35
- import { EnvironmentVariables } from '../../common/variables/types' ;
35
+ import { EnvironmentVariables , IEnvironmentVariablesProvider } from '../../common/variables/types' ;
36
36
import { TerminalShellType } from '../../common/terminal/types' ;
37
37
import { OSType } from '../../common/utils/platform' ;
38
38
import { normCase } from '../../common/platform/fs-paths' ;
@@ -81,6 +81,8 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
81
81
@inject ( ITerminalDeactivateService ) private readonly terminalDeactivateService : ITerminalDeactivateService ,
82
82
@inject ( IPathUtils ) private readonly pathUtils : IPathUtils ,
83
83
@inject ( IShellIntegrationService ) private readonly shellIntegrationService : IShellIntegrationService ,
84
+ @inject ( IEnvironmentVariablesProvider )
85
+ private readonly environmentVariablesProvider : IEnvironmentVariablesProvider ,
84
86
) {
85
87
this . separator = platform . osType === OSType . Windows ? ';' : ':' ;
86
88
this . progressService = new ProgressService ( this . shell ) ;
@@ -119,6 +121,13 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
119
121
this ,
120
122
this . disposables ,
121
123
) ;
124
+ this . environmentVariablesProvider . onDidEnvironmentVariablesChange (
125
+ async ( r : Resource ) => {
126
+ await this . _applyCollection ( r ) . ignoreErrors ( ) ;
127
+ } ,
128
+ this ,
129
+ this . disposables ,
130
+ ) ;
122
131
this . applicationEnvironment . onDidChangeShell (
123
132
async ( shell : string ) => {
124
133
this . processEnvVars = undefined ;
0 commit comments