Cygwin is a blessing for all us unix-backgrounded developers hacking out a living on Windows boxen. Last night I came across a new Cygwin package, chere, a tool for adding shell prompt options to the Explorer right-click menu.
It is possible to do it yourself by mucking around in Explorer's File Types options page, but why bother when you can use one chere command instead?
chere -ian2 -s bash
The downside is that you will have to be careful who uses your computer afterwards - the created menu item says "Bash here".
Comments
I've been using a home-brewed version of this for several years now:
1) Install the MS Windows "Command Prompt Here" PowerToy:
http://www.google.ca/search?q=microsoft+windows+powertoy+command+here
(it's the microsoft-approved way to get a new DOS shell by right clicking anything in the Windows Explorer.)
2) UnZip UnxUtils, and add its 'wbin' dir to your %PATH%
http://unxutils.sourceforge.net/
(all that's *really* required for this hack is pwd.exe)
3) modify C:\cygwin\cygwin.bat:
@echo off pushd . PWD > "%HOME%\cyg.dir" C: chdir C:\cygwin\bin bash --login -i popd4) Ensure C:\cygwin is on your %PATH%
5) set %HOME% in your Windows environment
6) Add the following to the VERY END of your $HOME/.bashrc:
if [ -f "$HOME/cyg.dir" ] ; then cwd_win=$( cat $HOME/cyg.dir | ~/ds/bin/trim-whitespace.pl) cd "$( cygpath -u "$cwd_win" )" rm -f "$HOME/cyg.dir" fiOver the years I've tuned it to work evn if $HOME is something with spaces (like %USERPROFILE%), but I much prefer setting HOME=c:\ddd for ease of typing and less paths-with-spaces-hell.