@@ -8,7 +8,7 @@ import { ITerminalManager } from '../../common/application/types';
8
8
import { pathExists } from '../../common/platform/fs-paths' ;
9
9
import { _SCRIPTS_DIR } from '../../common/process/internal/scripts/constants' ;
10
10
import { identifyShellFromShellPath } from '../../common/terminal/shellDetectors/baseShellDetector' ;
11
- import { TerminalShellType } from '../../common/terminal/types' ;
11
+ import { ITerminalHelper , TerminalShellType } from '../../common/terminal/types' ;
12
12
import { Resource } from '../../common/types' ;
13
13
import { waitForCondition } from '../../common/utils/async' ;
14
14
import { cache } from '../../common/utils/decorators' ;
@@ -37,6 +37,7 @@ export class TerminalDeactivateService implements ITerminalDeactivateService {
37
37
constructor (
38
38
@inject ( ITerminalManager ) private readonly terminalManager : ITerminalManager ,
39
39
@inject ( IInterpreterService ) private readonly interpreterService : IInterpreterService ,
40
+ @inject ( ITerminalHelper ) private readonly terminalHelper : ITerminalHelper ,
40
41
) { }
41
42
42
43
@cache ( - 1 , true )
@@ -58,7 +59,11 @@ export class TerminalDeactivateService implements ITerminalDeactivateService {
58
59
globalInterpreters . length > 0 && globalInterpreters [ 0 ] ? globalInterpreters [ 0 ] . path : 'python' ;
59
60
const checkIfFileHasBeenCreated = ( ) => pathExists ( outputFile ) ;
60
61
const stopWatch = new StopWatch ( ) ;
61
- terminal . sendText ( `${ interpreterPath } "${ this . envVarScript } " "${ outputFile } "` ) ;
62
+ const command = this . terminalHelper . buildCommandForTerminal ( shellType , interpreterPath , [
63
+ this . envVarScript ,
64
+ outputFile ,
65
+ ] ) ;
66
+ terminal . sendText ( command ) ;
62
67
await waitForCondition ( checkIfFileHasBeenCreated , 30_000 , `"${ outputFile } " file not created` ) ;
63
68
traceVerbose ( `Time taken to get env vars using terminal is ${ stopWatch . elapsedTime } ms` ) ;
64
69
}
0 commit comments