VsDevCmdGenerator: respect the user's startingDirectory (#15035)

The PowerShell equivalent was added in the initial pull request, #7774.

Closes #13721
This commit is contained in:
Dustin L. Howett
2023-03-23 18:14:48 -05:00
committed by GitHub
parent 0f7d1f4568
commit f06cd1759f
2 changed files with 4 additions and 0 deletions

View File

@@ -1771,6 +1771,7 @@ srv
srvinit
srvpipe
ssa
startdir
STARTF
STARTUPINFO
STARTUPINFOEX

View File

@@ -42,6 +42,9 @@ std::wstring VsDevCmdGenerator::GetProfileCommandLine(const VsSetupConfiguration
commandLine.reserve(256);
commandLine.append(LR"(cmd.exe /k ")");
commandLine.append(GetDevCmdScriptPath(instance));
// The "-startdir" parameter will prevent "vsdevcmd" from automatically
// setting the shell path so the path in the profile will be used instead.
commandLine.append(LR"(" -startdir=none)");
#if defined(_M_ARM64)
commandLine.append(LR"(" -arch=arm64 -host_arch=x64)");
#elif defined(_M_AMD64)