Skip to content

Commit d1f642e

Browse files
authored
Merge branch 'main' into quote-executable-task
2 parents 1c15d37 + fefc113 commit d1f642e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/features/pythonApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class PythonEnvironmentApiImpl implements PythonEnvironmentApi {
318318
environment,
319319
);
320320
await runInTerminal(environment, terminal, options);
321-
return terminal;
321+
return Promise.resolve(terminal);
322322
}
323323
runAsTask(environment: PythonEnvironment, options: PythonTaskExecutionOptions): Promise<TaskExecution> {
324324
return runAsTask(environment, options);

src/managers/pyenv/pyenvUtils.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ function nativeToPythonEnv(
177177

178178
const sv = shortVersion(info.version);
179179
const name = info.name || info.displayName || path.basename(info.prefix);
180-
const displayName = info.displayName || `pyenv (${sv})`;
180+
let displayName = info.displayName || `pyenv (${sv})`;
181+
if (info.kind === NativePythonEnvironmentKind.pyenvVirtualEnv) {
182+
displayName = `${name} (${sv})`;
183+
}
181184

182185
const shellActivation: Map<string, PythonCommandRunConfiguration[]> = new Map();
183186
const shellDeactivation: Map<string, PythonCommandRunConfiguration[]> = new Map();
@@ -232,7 +235,10 @@ export async function refreshPyenv(
232235
const envs = data
233236
.filter((e) => isNativeEnvInfo(e))
234237
.map((e) => e as NativeEnvInfo)
235-
.filter((e) => e.kind === NativePythonEnvironmentKind.pyenv);
238+
.filter(
239+
(e) =>
240+
e.kind === NativePythonEnvironmentKind.pyenv || e.kind === NativePythonEnvironmentKind.pyenvVirtualEnv,
241+
);
236242

237243
const collection: PythonEnvironment[] = [];
238244

0 commit comments

Comments
 (0)