Illusory Follies Sed quis debuget ipsos debugatores?

28Nov/071

Making Cygwin more handy

I enjoy having Cygwin installed on Windows and often like to use the shell commands (grep, find, etc.). However, it's inconvenient to spawn a new terminal window and slog through the often-complex Windows directory structure. Based off of some websites I found, I now have a way to make this work...

Create a batch script file in your Cygwin /bin folder (for me, this is C:\Cygwin\bin) with the following:

@cd /d %1
 
@bash --rcfile BASCHRC -i

Create a file called "bashcontext.reg" and save the following text into it:

[HKEY_CLASSES_ROOT\Directory\shell\bash]
@="Open Bash shell here"
 
[HKEY_CLASSES_ROOT\Directory\shell\bash\command]
@="C:\\Cygwin\\bin\\runBash.bat \"%1\""
 
[HKEY_CLASSES_ROOT\Drive\shell\bash]
@="Open Bash shell here"
 
[HKEY_CLASSES_ROOT\Drive\shell\bash\command]
@="C:\\Cygwin\\bin\\runBash.bat \"%1\""
 
[HKEY_CLASSES_ROOT\*\shell\bash]
@="Open Bash shell here"
 
[HKEY_CLASSES_ROOT\*\shell\bash\command]
@="C:\\Cygwin\\bin\\runBash.bat \"%1\""

You can add the registry information by double-clicking the file to run it.

Now on every directory you have a "Open Bash shell here" option that will take you there immediately. Handy!

Here's a screenshot showing my cluttered context menu:

clutteredcontext.png

Comments (1) Trackbacks (0)
  1. Do, carodd Duw y byd gymaint nes iddo roi ei unig Fab, er mwyn i bob un sy’n credu ynddo ef beidio รข mynd i ddistryw ond cael bywyd tragwyddol.


Leave a comment

(required)

No trackbacks yet.