I'm currently trying to set up my environment such that I can open a ConEmu tab and it will automatically initialize Far Manager and the VS Developer Command Prompt environment.
My failed attempt was this:
cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64_x86 & far -new_console:d:C:\My\Code
This works in that it accomplishes what I want, but ConEmu doesn't like it because it leaves an active cmd.exe instance, so when you try to close the tab you will always get a warning, which is not ideal.
If you've never seen this before, this is what pops up on tab closure if you use the above task:
After a whole bunch of searching I found this link which contains a comment at the bottom by the ConEmu author:
He says this:
Yep, that is working. But this method left cmd.exe in your working process tree.
Another way - run vcvarsall.bat from you shell (PowerShell or Far Manager) and export changed environment from cmd to the parent process. The advantage - you can set up different settings at run time.
And example command (I'm using that from Far Manager): "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 & "%ConEmuBaseDir%\ConEmuC.exe" /export=CON
The problem with this however is that I have to run this command manually after running far. I can't seem to find a way to automatically run that command after initializing Far.
It's not really a viable solution to do it manually because I have so many different environments to set up. Consider that I want a different tab for each compiler I'm using (MSVC, Clang, GCC, Intel C++ - sometimes multiple version of each, and pretty much always multiple architectures).
Basically I need a way to set up a task such that I can either run a batch file, followed by Far (so it inherits the env vars) without leaving a dangling cmd.exe instance. Or, I need to be able to set up a task such that I can automatically run a command (different per task) after running Far.
I'm pretty sure there would be some black magic way to do it, but I'm not familiar enough with ConEmu/Far yet to figure it out.
If I get super desperate I'll probably end up writing a plugin, but I'd rather avoid that if I can.