This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Open bash at the current explorer directory?


At 2002-09-19 06:14, you wrote:
John,

it doesn't work for me. In the second invocation of bash via "exec
bash --noprofile --norc -i'' I don't see my environment variables and
aliases defined in ~/.profile. Did you actually put something in ~/.profile
and verified?

Thanks,
Frantisek
Sorry Frantisek et al,

Mea culpa. You are correct. I was not using a .profile at all, thanks for pointing out the problem. I have rearranged things and retested with a .profile. I placed

alias profilels1='ls -s'
export PROFILE2=ProfileVariable2
export PATH=/cygdrive/c/Temp:$PATH

in my .profile in my home directory. My OpenWith.reg file now contains:

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

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

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

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

[HKEY_CLASSES_ROOT\Directory\shell\JddCustom_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 --noprofile --norc -c \"export EXPLORERDIR=`cygpath -u '%1'`; exec bash --login -i\""

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

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

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

[HKEY_CLASSES_ROOT\Drive\shell\JddCustom_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 --noprofile --norc -c \"export EXPLORERDIR=`cygpath -u '%1'`; exec bash --login -i\""
====================== File: OpenWith.reg END CUT HERE=========================

I make the first invocation of bash avoid executing any scripts, then make the second exec invocation run the scripts instead. I don't get any double execution, the PATH variable doesn't get /cygdrive/c/Temp added to it twice, and I get the variables and aliases from both .profile and .bashrc. Notice the new EXPLORERDIR variable. The many quotes are needed for directory names with spaces! I had to add these lines at the very bottom of the global /etc/profile file to get it to change to the directory desired though:

if [ "$EXPLORERDIR" ]; then
cd "$EXPLORERDIR"
fi




===================================
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]