Developer Tips
by Zhihao Yuan
Visual Studio 2019 comes with shortcuts that activate the environment
for C++ build tools in the command line, such as “x64 Native Tools Command
Prompt for VS 2019,” but these shortcuts launch cmd.exe
.
Here is how to add them to Windows
Terminal.
First, click “Settings” in the menu, as shown in the screenshot above. You will then be able to edit the configuration JSON in Visual Studio. Add a new entry that looks like the following:
{
"guid": "{034113a1-f2bc-44e4-acd2-6d5d94b890e6}",
"name": "x64 Native Tools Command Prompt for VS 2019",
"commandline": "%comspec% /k \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"",
"startingDirectory": "%USERPROFILE%",
"hidden": false,
"icon": "ms-appdata:///roaming/DesktopDevCPP.png"
}
A few things to be aware of:
"guid"
with a new one by running the
[guid]::NewGuid()
command in PowerShell."commandline."
ms-appdata:///roaming
points to %LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState.