Skip to content

Commit b590de0

Browse files
committed
fix: cmd bricked after shell startup
1 parent a178d43 commit b590de0

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/features/terminal/startup/cmdStartup.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,20 @@ function getMainBatchFileContent(startupFile: string, existingContent?: string):
7373
content.push('rem startup used in HKCU\\Software\\Microsoft\\Command Processor key AutoRun');
7474
content.push('');
7575

76-
// Add our startup file call
77-
content.push('rem VS Code Python environment activation');
78-
content.push(`if exist "${startupFile}" call "${startupFile}"`);
79-
8076
// Add existing AutoRun content if any
8177
if (existingContent && existingContent.trim()) {
8278
content.push(existingContent);
8379
content.push('');
8480
}
8581

82+
// Add our startup file call
83+
content.push('rem VS Code Python environment activation');
84+
content.push('if not defined VSCODE_PYTHON_AUTOACTIVATE_GUARD (');
85+
content.push(' set "VSCODE_PYTHON_AUTOACTIVATE_GUARD=1"');
86+
content.push(` if exist "${startupFile}" call "${startupFile}"`);
87+
content.push(')');
88+
content.push('');
89+
8690
return content.join(lineSep);
8791
}
8892

0 commit comments

Comments
 (0)