@@ -8,7 +8,7 @@ import { ITerminalManager } from '../../common/application/types';
88import { pathExists } from '../../common/platform/fs-paths' ;
99import { _SCRIPTS_DIR } from '../../common/process/internal/scripts/constants' ;
1010import { identifyShellFromShellPath } from '../../common/terminal/shellDetectors/baseShellDetector' ;
11- import { TerminalShellType } from '../../common/terminal/types' ;
11+ import { ITerminalHelper , TerminalShellType } from '../../common/terminal/types' ;
1212import { Resource } from '../../common/types' ;
1313import { waitForCondition } from '../../common/utils/async' ;
1414import { cache } from '../../common/utils/decorators' ;
@@ -37,6 +37,7 @@ export class TerminalDeactivateService implements ITerminalDeactivateService {
3737 constructor (
3838 @inject ( ITerminalManager ) private readonly terminalManager : ITerminalManager ,
3939 @inject ( IInterpreterService ) private readonly interpreterService : IInterpreterService ,
40+ @inject ( ITerminalHelper ) private readonly terminalHelper : ITerminalHelper ,
4041 ) { }
4142
4243 @cache ( - 1 , true )
@@ -58,7 +59,11 @@ export class TerminalDeactivateService implements ITerminalDeactivateService {
5859 globalInterpreters . length > 0 && globalInterpreters [ 0 ] ? globalInterpreters [ 0 ] . path : 'python' ;
5960 const checkIfFileHasBeenCreated = ( ) => pathExists ( outputFile ) ;
6061 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 ) ;
6267 await waitForCondition ( checkIfFileHasBeenCreated , 30_000 , `"${ outputFile } " file not created` ) ;
6368 traceVerbose ( `Time taken to get env vars using terminal is ${ stopWatch . elapsedTime } ms` ) ;
6469 }
0 commit comments