Category Archives: Windows Apps

How do you pronounce mingw?

There are some things in life that are important. This is not one of them. But this is something you could argue with your co-workers about for days on end.

By the way, is anyone hiring?

Advertisements

How to set up Console2 to use bash

If you prefer to use bash over cmd, you can set up a bash tab in Console2 by going to Edit > Settings > Tabs, clicking the Add button, and setting the shell option to the location of your bash executable followed by the -l parameter (or –login). You can set the title to whatever you like, change the background color, etc.

Now, if you added the Console2 context menu entries that I described in my previous post, you might also like to change into the current directory when you invoke it from the context menu. Depending on what version of bash you have, you might need to put the following at the end of your .bashrc file in your home directory:

# Change to current directory when invoking from Windows Explorer context menu
cd -

I found that this step was not necessary if I used the version of bash that comes with Git (located at C:\Program Files (x86)\Git\bin\bash.exe on my system). However, it was necessary if I used the version that comes with cygwin (C:\cygwin\bin\bash.exe). Using the latter, the home directory used by bash was actually located at C:\cygwin\home\dave. This will (obviously) be different on your system.

EDIT 4/14/2015: It appears that Console2 is currently dormant. One alternative I’ve found is ConsoleZ, which is a fork of Console2. You can find it here: https://github.com/cbucher/console.

Then, use this script to create context menu entries:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\directory\shell\ConsoleZ]
@="Open ConsoleZ here"
[HKEY_CURRENT_USER\Software\Classes\directory\shell\ConsoleZ\command]
@="C:\\Users\\Dave\\AppData\\Local\\ConsoleZ\\Console.exe -d \"%V\""
[HKEY_CURRENT_USER\Software\Classes\directory\background\shell\ConsoleZ]
@="Open ConsoleZ here"
[HKEY_CURRENT_USER\Software\Classes\directory\background\shell\ConsoleZ\command]
@="C:\\Users\\Dave\\AppData\\Local\\ConsoleZ\\Console.exe -d \"%V\""

Update the path as appropriate.

How to add Console2 context menu entries in Windows

If you ever use the command line in Windows, you need to download Console2 immediately.

The first thing I noticed after installing it, however, is that it doesn’t add any context menu entries. I had to do quite a bit of research to come up with this registry hack:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Console2]
@="Open Console2 Here"
[HKEY_CLASSES_ROOT\Directory\shell\Console2\command]
@="C:\\Console2\\Console.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Console2]
@="Open Console2 Here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Console2\command]
@="C:\\Console2\\Console.exe"

If you want to copy and paste the text above into a .reg file, make sure the encoding is set to UCS-2 Little Endian before you try to import it into the registry.

EDIT 4/14/2015: It appears that Console2 is currently dormant. One alternative I’ve found is ConsoleZ, which is a fork of Console2. You can find it here: https://github.com/cbucher/console.

Then, use this script to create context menu entries:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\directory\shell\ConsoleZ]
@="Open ConsoleZ here"
[HKEY_CURRENT_USER\Software\Classes\directory\shell\ConsoleZ\command]
@="C:\\Users\\Dave\\AppData\\Local\\ConsoleZ\\Console.exe -d \"%V\""
[HKEY_CURRENT_USER\Software\Classes\directory\background\shell\ConsoleZ]
@="Open ConsoleZ here"
[HKEY_CURRENT_USER\Software\Classes\directory\background\shell\ConsoleZ\command]
@="C:\\Users\\Dave\\AppData\\Local\\ConsoleZ\\Console.exe -d \"%V\""

Update the path as appropriate.