@@ -19,7 +19,7 @@ import { getProgram, IDebugEnvironmentVariablesService } from './helper';
19
19
20
20
@injectable ( )
21
21
export class LaunchConfigurationResolver extends BaseConfigurationResolver < LaunchRequestArguments > {
22
- private isPythonSet = false ;
22
+ private isCustomPythonSet = false ;
23
23
24
24
constructor (
25
25
@inject ( IDiagnosticsService )
@@ -38,7 +38,7 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
38
38
debugConfiguration : LaunchRequestArguments ,
39
39
_token ?: CancellationToken ,
40
40
) : Promise < LaunchRequestArguments | undefined > {
41
- this . isPythonSet = debugConfiguration . python !== undefined ;
41
+ this . isCustomPythonSet = debugConfiguration . python !== undefined ;
42
42
if (
43
43
debugConfiguration . name === undefined &&
44
44
debugConfiguration . type === undefined &&
@@ -110,7 +110,9 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
110
110
debugConfiguration . envFile = settings . envFile ;
111
111
}
112
112
let baseEnvVars : EnvironmentVariables | undefined ;
113
- if ( this . isPythonSet ) {
113
+ if ( this . isCustomPythonSet || debugConfiguration . console !== 'integratedTerminal' ) {
114
+ // We only have the right activated environment present in integrated terminal if no custom Python path
115
+ // is specified. Otherwise, we need to explicitly set the variables.
114
116
baseEnvVars = await this . environmentActivationService . getActivatedEnvironmentVariables (
115
117
workspaceFolder ,
116
118
await this . interpreterService . getInterpreterDetails ( debugConfiguration . python ?? '' ) ,
0 commit comments