Open bash at the current explorer directory?

John Daniel Doucette john.doucette@jjmackay.ca
Wed Sep 18 14:03:00 GMT 2002


Igor,

With all the great info on the mailing list and some research on my own, 
this is the registry file I came up with to open a cygwin rxvt shell at the 
current explorer directory/drive.  It also includes the option to open a 
Command prompt at the explorer directory/drive (Horrors!).  It works under 
Win2000 SP3.  For XP, just replace the WINNT path segments (2!) with 
WINDOWS.  The first invocation of bash loads all the profile information 
but is not interactive so that it can CD to the right directory, then exec 
replaces the current shell without reading any profile information.  I 
diff'ed a PRINTENV output before and after the exec command and they proved 
to be the same.  My bashrc only gets executed once in this case. Hope this 
provides more info. I am still trying to figure out how to get those cute 
little icons in the context menu though!  All the keys have "Custom_" in 
their names to make them easy to find and remove if you don't like their 
function.

====================File: OpenWith.reg,  CUT HERE ===========================
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\Custom_OpenWithCommandPrompt]
@="Open with Command Prompt"

[HKEY_CLASSES_ROOT\Directory\shell\Custom_OpenWithCommandPrompt\command]
@="c:\\WINNT\\system32\\cmd.exe %1"

[HKEY_CLASSES_ROOT\Directory\shell\Custom_OpenWithCygwinShell]
@="Open with Cygwin Shell (rxvt)"

[HKEY_CLASSES_ROOT\Directory\shell\Custom_OpenWithCygwinShell\command]
@="C:\\cygwin\\bin\\rxvt.exe -geometry 96x76+800+5 -fg gray -bg black -fn 
Fixedsys-8 -sl 2500 -sr -tn cygwin -e c:/cygwin/bin/bash --login -c \"cd 
'%1'; exec bash --noprofile --norc -i\""

[HKEY_CLASSES_ROOT\Drive\shell\Custom_OpenWithCommandPrompt]
@="Open with Command Prompt"

[HKEY_CLASSES_ROOT\Drive\shell\Custom_OpenWithCommandPrompt\command]
@="c:\\WINNT\\system32\\cmd.exe /F:ON %1"

[HKEY_CLASSES_ROOT\Drive\shell\Custom_OpenWithCygwinShell]
@="Open with Cygwin Shell (rxvt)"

[HKEY_CLASSES_ROOT\Drive\shell\Custom_OpenWithCygwinShell\command]
@="C:\\cygwin\\bin\\rxvt.exe -geometry 96x76+800+5 -fg gray -bg black -fn 
Fixedsys-8 -sl 2500 -sr -tn cygwin -e c:/cygwin/bin/bash --login -c \"cd 
'%1'; exec bash --noprofile --norc -i\""
====================  CUT HERE ===========================

===================================
John Daniel Doucette, Sr. Software Designer

J. J. MacKay Canada Limited
Halifax R & D Office
1046 Barrington Street, 1st Floor
Halifax, Nova Scotia
Canada
B3H 2R1

Phone: 902.423.7727  x222
Fax:     902.422.8108
Web:    www . jjmackay . ca
Email:  john . doucette @ jjmackay . ca
===================================


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list