Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <61891BA043DED21180920090273F17380181775C@argentina.telogy.com> From: Arlen Barr To: cygwin AT sources DOT redhat DOT com Subject: RE: Bash Prompt Here Date: Tue, 3 Oct 2000 09:51:12 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id JAA03400 Another solution ... (this one for NT, but you get the idea) [HKEY_CLASSES_ROOT\Directory\shell\BashHere\command] c:\winnt\system32\cmd.exe /c cd "%1" && bash The same line should work with command.com instead of cmd.exe for win95 arlen -----Original Message----- From: Andre Oliveira da Costa [mailto:costa AT cade DOT com DOT br] Sent: Tuesday, October 03, 2000 9:44 AM To: cygwin AT sources DOT redhat DOT com Subject: RE: Bash Prompt Here I'm sorry, but I'll have do disagree... ;) I have just tried Andy's suggestion, and it indeed works -- *but* you have to remove the --login to prevent the shell from changing to your $HOME at startup. In my case, this meant I had to "improve" my ~/.bashrc file (importing some settings that were only on the ~/.profile). After that, the "BashHere" works ok. ... on a second thought, I'm not sure the behavior is 100% ok. The thing is: if you right-click a directory on an Explorer window and launch the "BashHere" command, bash will start on the directory displayed on the titlebar, and not on the highlighted dir. For me, this behavior is good enough, but I understand that others might not think that way. Best, Andre Costa -- André Oliveira da Costa (andre DOT costa AT starmedia DOT net) > -----Original Message----- > From: cygwin-owner AT sources DOT redhat DOT com > [mailto:cygwin-owner AT sources DOT redhat DOT com]On Behalf Of Luke Bakken > Sent: Tuesday, October 03, 2000 10:10 AM > To: Andy Philpotts > Cc: Evan McLean; cygwin AT sources DOT redhat DOT com > Subject: Re: Bash Prompt Here > > > Actually, this does not work, as you are not passing the directory > argument to bash in any way. > > You can try this, however, given to me by someone else recently on this > mailing list: > > [HKEY_CLASSES_ROOT\Directory\shell\BashHere\command] > c:\cygwin\sygwin2.bat %1 > > where cygwin2.bat = > > @set STARTIN=%1 %2 %3 %4 %5 %6 %7 %8 %9 > @c:\cygwin\bin\bash.exe --login -i > > Then, in your /etc/profile, change the cd $HOME line to this: > > if [ ! -z "$STARTIN" ]; then > if [ -d "$STARTIN" ]; then > cd "$STARTIN" > else > echo "$STARTIN is not a valid path." > cd $HOME > fi > unset STARTIN > else > cd $HOME > fi > > Mind that there is a limit with this solution to the number of spaces in > the directory argument. The method of redirecting %1 to a file also works > well, and actually was my first solution, but i like the above better. > The real problem is that, unlike cmd.exe, bash does not support an > "initial command" argument like the /K switch on cmd.exe. There is a -c > argument to bash, but bash exits after executing that command. > > > > On Tue, 3 Oct 2000, Andy Philpotts wrote: > > > Hello Evan, > > > > This seems a little simpler to me: > > > > [HKEY_CLASSES_ROOT\Directory\shell\BashHere\command] > > d:\cygwin\bin\bash.exe --login -i > > > > No extra files or indirection needed > > > > Monday, October 02, 2000, 6:20:09 PM, you wrote: > > > > EM> Hi, > > > > EM> I've come up with a way to right-click on a directory in > Windows Explorer > > EM> and have a menu option called "Bash Prompt Here" that will > open a bash > > EM> prompt with the selected directory as the current one. > It's a bit kludgy, > > EM> but I thought I'd submit it for any who may find it useful. > Works under > > EM> Win98 and WinME. Be interested to know how it goes on NT variants. > > > > EM> This is using cygwin 1.x and assumes that your cygwin > installation is in > > EM> "c:\cygwin" which is mounted as your root directory. > Change to suite your > > EM> own environment. > > > > EM> Create a file "c:\cygwin\start_at.bat" with the following > three lines: > > > > EM> @echo off > > EM> echo cd %1 > c:\cygwin\start_dir.txt > > EM> c:\cygwin\cygwin.bat > > > > EM> Add the following four lines to the end of "/etc/profile" (or > > EM> "c:\cygwin\etc\profile"): > > > > EM> if [ -f /start_dir.txt ] ; then > > EM> . /start_dir.txt > > EM> rm /start_dir.txt > > EM> fi > > > > EM> Lastly, apply the following registry patch file (which I name > > EM> "bash_prompt_here.reg"): > > EM> ----------snip---------- > > EM> REGEDIT4 > > > > EM> [HKEY_CLASSES_ROOT\Directory\shell\BashHere] > > EM> @="&Bash Prompt Here" > > > > EM> [HKEY_CLASSES_ROOT\Directory\shell\BashHere\command] > > EM> @="C:\\WINDOWS\\COMMAND.COM /E:4096 /c > C:\\cygwin\\start_at.bat \"%L\"" > > > > EM> ----------snip---------- > > > > EM> That's it. If anybody can offer any improvements, let me know. > > > > EM> E. > > > > > > EM> -- > > EM> Want to unsubscribe from this list? > > EM> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com > > > > > > > > -- > > Andy Philpotts > > Senior Software Developer > > CalendarCentral Inc. > > [w] 919/654-6200 xt.155 > > [c] 919/656-1166 > > [e] andy DOT philpotts AT calendarcentral DOT com > > [www] www.calendarcentral.com > > > > Andy says: I don't suffer from insanity, I enjoy every minute of it. > > > > > > > > -- > > Want to unsubscribe from this list? > > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com > > > > > -- > Want to unsubscribe from this list? > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com > -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com