9

My goal is to have a terminal with Unix commands (e.g. ls instead of dir), color, and working keys in my Windows 7 machine. My current attempt at getting this to work is using Git Bash in Console2. I created a new tab with:

Title: Git Bash
Icon: C:\Program Files\Git\mingw64\share\git\git-for-windows.ico
Shell: C:\Windows\System32\cmd.exe /C "C:\Program Files\Git\bin\bash.exe" --login -i
Startup dir: C:\Users\evesforeva

Git Bash gives me the Unix commands. Adding ansicon gives me color. But when I type Ctrl+C, it closes the whole tab. I need it to stop processes like rails server without closing the tab. I also tried different combinations of swapping C:\Windows\System32\cmd.exe for C:\Windows\SysWOW64\cmd.exe and C:\Program Files\Git\bin\bash.exe for C:\Program Files\Git\bin\sh.exe and got the same results.

A direct solution to the problem would be much appreciated, but if that's not possible, I’ll take anything that provides Unix commands, color, and working keys. I also tried using Git Bash directly with minTTY, but the arrow keys don't work and irb exits after one command. I even went as far as trying to install Ubuntu. My HP Probook 650 G1 won't let me change any of the BOIS settings, so neither dual-booting nor VirtualBox worked.

How do I prevent Ctrl+C from closing the tab when running Git Bash in Console2?

Eva
  • 223

3 Answers3

8

This worked for me:

Shell: C:\Windows\SysWOW64\cmd.exe /c "C:\Program Files\Git\usr\bin\bash.exe" --login -i

The bash.exe inside \Git\usr\bin seems to handle Ctrl-C normally.

*64bit Win7 using Git for Windows 2.6.1

budji
  • 191
3

Try the following

  1. "cmd.exe /c" in your command is superfluous. Remove it completely.
  2. Update to the latest git-for-windows. It has git-cmd.exe wrapper. To run it properly there are switches, something like "git-cmd.exe --cmd=/use/bin/sh.exe"
    1. Not sure about Console... Check your associated action for Ctrl+C hotkey. It may be configured improperly.
  3. Why do not give a try to ConEmu?
Maximus
  • 20,835
0

In short the solution is:

Take a terminal that works.

  1. I find a few working gitbash v2.32.0 or gitbash v2.34.1

The latest available gitbash currently is v2.38.1. But only the old one is working correctly with Vagrant(Oracle VM). The strange thing is that the latest one (gitbash v2.38.1) is working fine with SSH connections to AWS EC2 instances.

  1. Alternatively. Windows PowerShell is working fine with Vagrant(Oracle VM).

If someone needs my bad experience, here it is. The following terminals DON'T WORK

  • gitbash v2.38.1 (latest for now)
  • gitbash V2.36.0
  • ConEmu v220807 Alhpa (latest for now)
  • cmder v1.3.20.1282 (latest for now)