4

Sometimes I write some Console Applications in Visual Studio that must be run in a terminal, and I get the MS-DOS command prompt. I've been searching for a way to change the default command prompt in Visual Studio, with no luck so far.

I don't use Windows a lot for programming, but I do have Git installed, and I really like the Git Bash. I was wondering if there is a way to tell Visual Studio to open the Git Bash (or any other "console" program) instead of the MS-DOS command prompt when I run a Console Application, without breaking too many things or VS configurations.

I'm using Visual Studio 2012 on Windows 7.

P.D. I'm not a Windows user!!

mestevens
  • 359
  • 4
  • 11
  • git bash is just a different shell; you aren't running a shell at all. Your question doesn't actually make sense. Are you really asking how to change the font? – SLaks Jan 04 '15 at 16:54
  • What command prompt? Running your program does not run a shell. How are you starting it? – SLaks Jan 04 '15 at 17:01
  • @SLaks Not sure I understand your question, but I go to File > New > Project > Console Application, then I write my code, and then I press the Play button. This opens a command prompt to run my app. What I want is to tell VS to open the Git Bash instead of the MS-DOS command prompt. Does that make sense? – mestevens Jan 04 '15 at 17:07
  • No. git bash is no different from "MS-DOS" (which actually isn't), except that it runs bash instead of cmd. But you aren't running cmd; you're running your own app. What functionality are you talking about? – SLaks Jan 04 '15 at 17:14
  • git bash is a shell, not a console. You could set the start action to run Console2 or PowerCMD, but you may have issues with the debugger. – SLaks Jan 04 '15 at 17:27
  • This looks like a dupe: http://stackoverflow.com/questions/12602411/use-custom-console-for-visual-studio-console-application-debugging – khellang Jan 04 '15 at 17:40
  • Or this: http://stackoverflow.com/questions/4088123/use-console2-for-visual-studio-debugging – khellang Jan 04 '15 at 17:41
  • GIT bash is just C:\WINDOWS\system32\cmd.exe /c ""C:\Program Files\Git\bin\sh.exe" --login -i" which is basically your cmd prompt running sh.exe – cup Jan 04 '15 at 17:49
  • @khellang Not sure if it is the same, I'm not exactly debugging, I'm not using VS 2010 and I am not using ConEmu... – mestevens Jan 04 '15 at 20:02

1 Answers1

3

Unfortunately you can not change the default launch action, but you can set the command to invoke for the project on the Project Properties' Debug tab set the application to launch:

enter image description here

You will need to attach to your process after launch, as it will be attached to bash and not the application being debugged.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341