Commit 9bcb82d Kartik Raj
authored
1 parent 713007f commit 9bcb82d Copy full SHA for 9bcb82d
File tree 2 files changed +9
-5
lines changed
pythonEnvironments/base/locators/lowLevel
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,10 @@ function getDirFilesLocator(
94
94
// take a naive approach.
95
95
async function * iterEnvs ( query : PythonLocatorQuery ) : IPythonEnvsIterator < BasicEnvInfo > {
96
96
traceVerbose ( 'Searching for windows path interpreters' ) ;
97
- yield * await getEnvs ( locator . iterEnvs ( query ) ) ;
98
- traceVerbose ( 'Finished searching for windows path interpreters' ) ;
97
+ yield * await getEnvs ( locator . iterEnvs ( query ) ) . then ( ( res ) => {
98
+ traceVerbose ( 'Finished searching for windows path interpreters' ) ;
99
+ return res ;
100
+ } ) ;
99
101
}
100
102
return {
101
103
providerId : locator . providerId ,
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export class TerminalCodeExecutionProvider implements ICodeExecutionService {
30
30
) { }
31
31
32
32
public async executeFile ( file : Uri , options ?: { newTerminalPerFile : boolean } ) {
33
- await this . setCwdForFileExecution ( file ) ;
33
+ await this . setCwdForFileExecution ( file , options ) ;
34
34
const { command, args } = await this . getExecuteFileArgs ( file , [
35
35
file . fsPath . fileToCommandArgumentForPythonExt ( ) ,
36
36
] ) ;
@@ -88,7 +88,7 @@ export class TerminalCodeExecutionProvider implements ICodeExecutionService {
88
88
newTerminalPerFile : options ?. newTerminalPerFile ,
89
89
} ) ;
90
90
}
91
- private async setCwdForFileExecution ( file : Uri ) {
91
+ private async setCwdForFileExecution ( file : Uri , options ?: { newTerminalPerFile : boolean } ) {
92
92
const pythonSettings = this . configurationService . getSettings ( file ) ;
93
93
if ( ! pythonSettings . terminal . executeInFileDir ) {
94
94
return ;
@@ -106,7 +106,9 @@ export class TerminalCodeExecutionProvider implements ICodeExecutionService {
106
106
await this . getTerminalService ( file ) . sendText ( `${ fileDrive } :` ) ;
107
107
}
108
108
}
109
- await this . getTerminalService ( file ) . sendText ( `cd ${ fileDirPath . fileToCommandArgumentForPythonExt ( ) } ` ) ;
109
+ await this . getTerminalService ( file , options ) . sendText (
110
+ `cd ${ fileDirPath . fileToCommandArgumentForPythonExt ( ) } ` ,
111
+ ) ;
110
112
}
111
113
}
112
114
}
You can’t perform that action at this time.
0 commit comments