Git Bash Here in Console2 in Total Commander with keyboard shortcut (hotkey)?
May 5, 2013 2 Comments
Edit 13.8.2014: While still valid, I’d go for ConEmu now. See relevant section in this newer post to set up “bash here” from Total Commander using INI files.
Not sure whether I ever made longer title – but as I had to Google a lot about it and even wrote to Total Commander support email I decided to put it “on paper”. I wanted to press a keyboard shortcut to open Git Bash in Console2 (default window is just as terrible as “cmd”, marking, copying and pasting is just pure pain). Of course in current directory.
Because I have installed Cygwin as well and had it as a default shell for Console2, I decided to add a new tab configuration like this:
Main menu: Edit-Settings-Tabs-Add and then fill up things accordingly
Now the Total Commander part. While I googled a lot how to assign my custom command to a shortcut (hotkey) maybe I used different keywords, maybe I was just unlucky… I wrote to support in the end. Answer goes as this (thanks to Christian Ghisler):
Go to menu Configuration – Options (you can get here with Alt-O twice) – Misc (last option in the list on the left)
Choose your hotkey, I went for Ctrl+B (it doesn’t make any file “bold” I hope)
Click on the small magnifying glass
Click on usercmd.ini (all the way down)
Click on New
Choose a name, e.g. em_git_bash_here
Enter the details (see lower)
Click OK in all open dialogs
Here is screenshot of the settings in Total Commander:
Here the -t obviously chooses the tab you want to open and -d sets the initial working directory.
BTW: The last dialog is the same like for a custom button. I actually found a blog about how to add a custom button with Git Bash Here, but assigning it to a hotkey was another story. Also running it in Console2 was easier than it seemed from various internet resources. Many advices pointed to the Windows Registry – but I didn’t want that.
Total Commander itself is a bit tricky. Don’t get me wrong, I love it and that’s why I have bought it (way too late, but I have) and also could appreciate support (right to the point). But when you want to find that %P is “current directory” you better google it. Ctrl+F in the Help window (very good one actually) does not help, because “source path” does not contain neither “current” nor “directory” obviously. 🙂 With Internet at hand these are no problems at all.
BTW2: If you have your command in Total Commander named you can just reference it when you need it for button bar – don’t click on magnifying glass icon, just set Command value to “em_git_bash_here” (or however you named it) and you’re done.
Hope you made it with my procedure and my pictures. May the power of keyboard shortcuts (or hotkeys, whatever ;-)) be with you!