Skip to content

Instantly share code, notes, and snippets.

@ThatRendle
Created November 25, 2010 17:31
Show Gist options
  • Save ThatRendle/715674 to your computer and use it in GitHub Desktop.
Save ThatRendle/715674 to your computer and use it in GitHub Desktop.
Modified Git Bash to use Console2
Console2 is awesome, and makes working with the command line on Windows much easier.
The problem I had was that when I used the "Git Bash Here" item on Windows Explorer context menus,
it was using the standard command prompt shell. I tracked down the VBS script that is used by the
menu item, and modified it to launch Console2 with the Git Bash settings instead. Below is the
modified VBS script and the Git Bash tab section from my console.xml file.
Obviously path names may vary.
Set AppObj = CreateObject("Shell.Application")
If WScript.Arguments.Length=1 Then
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash"" -d """ & WScript.Arguments(0) & """"
Else
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash"""
End If
<tab title="Git Bash" use_default_icon="0">
<console shell="&quot;C:\Program Files\Git\bin\sh.exe&quot; --login -i"
init_dir="%HOMEDRIVE%%HOMEPATH%"
run_as_user="0"
user=""/>
<cursor style="0" r="255" g="255" b="255"/>
<background type="0" r="0" g="0" b="0">
<image file="" relative="0" extend="0" position="0">
<tint opacity="0" r="0" g="0" b="0"/>
</image>
</background>
</tab>
@levlaz
Copy link

levlaz commented Nov 22, 2014

Thank you so much! This is just what I was looking for. One thing to note for anyone who has any issues running this on a 64 bit version of Windows. Make sure you change the following line in the XML config file.

FROM:
<console shell=""C:\Program Files\Git\bin\sh.exe" --login -i"

TO:
<console shell=""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment