Skip to content

Commit 40cf40d

Browse files
committed
fix: partial fix for create terminal command in multi-root
1 parent 8f5da1a commit 40cf40d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/features/envCommands.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,15 @@ export async function createTerminalCommand(
460460
api: PythonEnvironmentApi,
461461
tm: TerminalManager,
462462
): Promise<Terminal | undefined> {
463-
if (context instanceof Uri) {
463+
if (context === undefined) {
464+
const pw = await pickProject(api.getPythonProjects());
465+
if (pw) {
466+
const env = await api.getEnvironment(pw.uri);
467+
if (env) {
468+
return await tm.create(env, { cwd: pw.uri });
469+
}
470+
}
471+
} else if (context instanceof Uri) {
464472
const uri = context as Uri;
465473
const env = await api.getEnvironment(uri);
466474
const pw = api.getPythonProject(uri);

0 commit comments

Comments
 (0)