From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3702 invoked by alias); 18 Sep 2002 15:11:11 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 3693 invoked from network); 18 Sep 2002 15:11:09 -0000 Received: from unknown (HELO slinky.cs.nyu.edu) (128.122.20.14) by sources.redhat.com with SMTP; 18 Sep 2002 15:11:09 -0000 Received: from localhost (pechtcha@localhost) by slinky.cs.nyu.edu (8.11.6+Sun/8.11.6) with ESMTP id g8IFB7r09920; Wed, 18 Sep 2002 11:11:07 -0400 (EDT) X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Wed, 18 Sep 2002 08:26:00 -0000 From: Igor Pechtchanski Reply-To: cygwin@cygwin.com To: Frantisek Dufka cc: cygwin@cygwin.com Subject: Re: Open bash at the current explorer directory? In-Reply-To: <000901c25f06$bb88ea70$5365060a@franta> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-09/txt/msg00885.txt.bz2 As I posted earlier, you can avoid calling both ~/.bashrc and /etc/profile by running bash with a "-i" option ( http://www.cygwin.com/ml/cygwin/2002-09/msg00680.html ). So invoke the first bash as '-e bash --login -i', and the second as 'exec bash --rcfile ~/.profile'. You may get ~/.bashrc executed on the second invocation. You will lose the system-wide settings that are set in /etc/profile, though. Igor On Wed, 18 Sep 2002, Frantisek Dufka wrote: > Umm they both work, sort of. As I said before, the user profile gets > executed twice. If you run some executable from the user profile which > should run only once, it's a problem. > > First invocation is from the '-e /usr/bin/bash --login' part, the second is > from the 'exec bash --rcfile ~/.profile' (or 'exec -l bash') > > My solution runs bash only once and I have no problems with it so far. I > just wanted to share. I hope it's clear now :) > > Frantisek > > ----- Original Message ----- > From: "John Vincent" > To: ; > Cc: > Sent: Wednesday, September 18, 2002 1:02 PM > Subject: Re: Open bash at the current explorer directory? > > > > Hi, > > > > Here is an alternative that has also been posted before, that also > > works when it's a disk drive rather than a directory. Does > > this work any better for you? (Both work fine for me on W2K SP3) > > > > /John Vincent > > > > ---------------------------------------------- > > REGEDIT4 > > > > [HKEY_CLASSES_ROOT\Directory\shell\rxvtHere] > > @="r&xvtHere" > > > > [HKEY_CLASSES_ROOT\Directory\shell\rxvtHere\command] > > @="C:\\CYGWIN\\BIN\\rxvt.exe -sr -ut -tn rxvt -bg black -fg grey -fn > > \"Courier-16\" -sl 2000 -e /usr/bin/bash --login -i -c \"cd '%1';echo > > '%1';exec bash --rcfile ~/.profile -i\"" > > > > [HKEY_CLASSES_ROOT\Drive\shell\rxvtHere] > > @="r&xvtHere" > > > > [HKEY_CLASSES_ROOT\Drive\shell\rxvtHere\command] > > @="C:\\CYGWIN\\BIN\\rxvt.exe -sr -ut -tn rxvt -bg black -fg grey -fn > > \"Courier-16\" -sl 2000 -e /usr/bin/bash --login -i -c \"cd '%1';echo > > '%1';exec bash --rcfile ~/.profile -i\"" > > --------------------------------------------- > > > > >From: "Frantisek Dufka" > > >To: "Marcos Lorenzo de Santiago" > > >CC: > > >Subject: Re: Open bash at the current explorer directory? > > >Date: Wed, 18 Sep 2002 12:42:09 +0200 > > > > > >Sure. We are both talking about following key, right? > > > > > >Windows Registry Editor Version 5.00 > > > > > >[HKEY_CLASSES_ROOT\Directory\shell\0cmd-rxvt] > > >@="Open rxvt Window Here" > > > > > >[HKEY_CLASSES_ROOT\Directory\shell\0cmd-rxvt\command] > > >@="C:\\cygwin\\bin\\rxvt.exe -bg black -fg white -sr -sl 1000 -fn > > >\"Fixedsys\" -ls -e /usr/bin/bash --login -c \"cd \\\"`cygpath -u > > >'%1'`\\\"; > > >exec bash\"" > > > > > >It didn't work for me. My settings in .bash_profile were not executed in > > >the > > >final 'exec bash' but in the -e /usr/bin/bash, which is wrong, because it > > >gets forgotten by the exec'ed shell. If you add -l (exec -l bash) it is > > >executed twice. In my case it tells me two fortune cookies instead of one. > > >That's nice, but they may run out quickly :) > > > > > >Frantisek > > > > > >----- Original Message ----- > > >From: "Marcos Lorenzo de Santiago" > > >To: "Frantisek Dufka" > > >Cc: > > >Sent: Wednesday, September 18, 2002 11:05 AM > > >Subject: Re: Open bash at the current explorer directory? > > > > > > > > > > > > > I don't know how to do it without using .bashrc, but this works for > > > > me (current cygwin, NT 4.0) > > > > > > > > Registry key contains: > > > > > > > > D:\cygwin\bin\rxvt.exe -sb -sr -sl 16384 -fn fixedsys -fg gray -bg > > > > black -e /bin/env CFH="%1" /bin/bash --login > > > > > > > > .bashrc contains > > > > > > > > if [ "$CFH" != "" ] ; then > > > > cd "$CFH" > > > > unset CFH > > > > fi > > > > > > > > No temporary files, bash.exe or .bash_profile is not executed twice. > > > > Also looks like cygpath -u is not needed, DOS paths seem to work in > > > > cd command. > > > > > >Not long ago someone posted a registry key to do this with right-click > > >button option. It works quite well and you can modify the key to your own > > >preferences (background colour, font colour, etc.). Someone posted a way > > >to opne a explorer from current bash PWD. > > > > > >rgrds, > > >m4c. > > > > > > > > > > > > > > Frantisek > > > > > > > > ------------------------------------- > > > > * John Daniel Doucette [13-09-02 15:23]: > > > > > I am using Win2000 Pro, SP3. Is there a way to invoke an > > > > > interactive bash shell at a particular directory, without > > > > > using a .bashrc or similar file? > > > > > I.e. on the command lie alone? The --login and -c options > > > > > appear to be mutually exclusive. I would like to be able > > > > > browse quickly to a directory with explorer, option/right > > > > > click on the directory, then select a custom "open with > > > > > cygwin" option, and have the bash shell open at that > > > > > directory. Has anyone tried this? > > > > > > > > Read this from the archive. > > > > http://www.cygwin.com/ml/cygwin/2002-05/msg01648.html > > > > > > > > HTH > > > > Jens -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51 -- 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/