The following two paragraphs are background – they just explain why I need to do such a weird thing. If you don’t care you can skip them and go directly to the question.
I’m a Vim user and I started learning C#. Naturally I want to use MSBuild as my makeprg. I want to bind hotkeys for common development operations – Build, Clean and Run. Since I want to set my hotkeys globally, I have a problem as the files’ names are different in each and every project.
In GCC/MinGW this problem could be solved easily – since I’m already storing the important file names in variables, I can simply add to the makefile targets for cleaning the build and running the program, and then bind hotkeys to “:make! Clean” and “:make! Run”. So I figured I could do the same thing with MSBuild targets. It works great for Clean with the Delete tag(not sure I really need clean in .NET, but you know – force of habit), but I have a problem with Run.
Now, this is my problem: unlike GCC/MinGW’s makefiles, which are simply clever batch files that run shell commands, MSBuild uses it’s own set of commands and runs them internally. That means that Exec tasks run the program without a shell – I can open windows, but I can’t use it to test interactive shell programs.
Is there any way to persuade MSBuild to give me an interactive shell?
Have you tried some variation of this,
After escaping it works out to roughly this,
Which will run your command within a command shell (/k may not be the right cmd switch for your usage), then when your interactive program exits, it will run the “exit” command and move on.