Skip to content

Fix #532: DEVPATH env variable not being set for integrated console #570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,19 @@ export class SessionManager {
"-Command",
"& '" + startScriptPath + "' " + startArgs);

// Set DEVPATH environment variable if necessary
if (isWindowsDevBuild) {
// The development build looks for this environment variable to
// know where to find its assemblies
process.env.DEVPATH = path.dirname(powerShellExePath);
}
else {
// It's safe to delete this variable even if it doesn't exist
delete process.env.DEVPATH;
// Windows PowerShell development builds need the DEVPATH environment
// variable set to the folder where development binaries are held

// NOTE: This batch file approach is needed temporarily until VS Code's
// createTerminal API gets an argument for setting environment variables
// on the launched process.
var batScriptPath = path.resolve(__dirname, '../sessions/powershell.bat');
fs.writeFileSync(
batScriptPath,
`@set DEVPATH=${path.dirname(powerShellExePath)}\r\n@${powerShellExePath} %*`);

powerShellExePath = batScriptPath;
}

// Make sure no old session file exists
Expand Down