Bash Prompt Here
Evan McLean
ev@deathsdoor.com
Mon Oct 2 15:20:00 GMT 2000
Hi,
I've come up with a way to right-click on a directory in Windows Explorer
and have a menu option called "Bash Prompt Here" that will open a bash
prompt with the selected directory as the current one. It's a bit kludgy,
but I thought I'd submit it for any who may find it useful. Works under
Win98 and WinME. Be interested to know how it goes on NT variants.
This is using cygwin 1.x and assumes that your cygwin installation is in
"c:\cygwin" which is mounted as your root directory. Change to suite your
own environment.
Create a file "c:\cygwin\start_at.bat" with the following three lines:
@echo off
echo cd %1 > c:\cygwin\start_dir.txt
c:\cygwin\cygwin.bat
Add the following four lines to the end of "/etc/profile" (or
"c:\cygwin\etc\profile"):
if [ -f /start_dir.txt ] ; then
. /start_dir.txt
rm /start_dir.txt
fi
Lastly, apply the following registry patch file (which I name
"bash_prompt_here.reg"):
----------snip----------
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\BashHere]
@="&Bash Prompt Here"
[HKEY_CLASSES_ROOT\Directory\shell\BashHere\command]
@="C:\\WINDOWS\\COMMAND.COM /E:4096 /c C:\\cygwin\\start_at.bat \"%L\""
----------snip----------
That's it. If anybody can offer any improvements, let me know.
E.
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
More information about the Cygwin
mailing list