MSVC environment variables in git bash using ConEmu

1.5k views Asked by At

I'm trying to start git bash with environment variables from vcvarsall.bat using ConEmu.

Currently my startup task is just "C:\Program Files\Git\bin\vc14.bat". The bat file looks as following:

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
cls
"C:\Program Files\Git\bin\sh.exe" --login -i

The problem is that when I close ConEmu I get this message

enter image description here

Is there any way to do what my bat file is doing from ConEmu?

1

There are 1 answers

0
Maximus On BEST ANSWER
  1. You should use C:\Program Files\Git\usr\bin\sh.exe instead of C:\Program Files\Git\bin\sh.exe because Git\bin\sh.exe is just a wrapper.
  2. You should run sh.exe asynchronously, because when you run it from cmd's batch, cmd.exe waits for for sh.exe completion, and ConEmu sees the cmd.exe in the console process, which rises "Incomplete operations" warning.

Correct batch:

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
cls
ConEmuC -async -c "C:\Program Files\Git\bin\sh.exe" --login -i