From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26537 invoked by alias); 28 May 2002 14:19:15 -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 26407 invoked from network); 28 May 2002 14:19:07 -0000 Received: from unknown (HELO smtpcl1.fiducia.de) (195.200.32.50) by sources.redhat.com with SMTP; 28 May 2002 14:19:07 -0000 Received: from xcsmtp01.fag.fiducia.de ([10.253.17.9]) by smtpcl1.fiducia.de (8.11.6/8.11.6) with ESMTP id g4SEJ2o10193; Tue, 28 May 2002 16:19:03 +0200 (MEST) MIME-Version: 1.0 Sensitivity: To: "Gerrit P. Haase" Cc: cygwin@cygwin.com Subject: Re: Bash Here - Start Cygwin from a folders context menu From: "Thomas Schweikle" Message-ID: Date: Tue, 28 May 2002 10:57:00 -0000 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2002-05/txt/msg01696.txt.bz2 Hi! Bitte antworten an "Gerrit P. Haase" Gesendet von: cygwin-owner@cygwin.com An: David Starks-Browning Kopie: cygwin@cygwin.com Thema: Re: Bash Here - Start Cygwin from a folders context menu >> I'd like it to work before I reference it in the FAQ. Fine! > Well, it was some fiddeling. > It worked well but now as I tried > to reinstall, it doesn't work on > mounted drives anymore:-( I've done it some time ago. Here's what I did: first I took a close look on how others where dooing it. Then created a file: --- start of "bash-here.reg" --- REGEDIT4 [HKEY_CLASSES_ROOT\Drive\shell\bashHere] @="Shell: bash prompt here" [HKEY_CLASSES_ROOT\Drive\shell\bashHere\command] @="C:\\Programme\\Cygwin\\cygwin.bat \"%1\"" [HKEY_CLASSES_ROOT\Directory\shell\bashHere] @="Shell: bash prompt here" [HKEY_CLASSES_ROOT\Directory\shell\bashHere\command] @="C:\\Programme\\Cygwin\\cygwin.bat \"%1\"" --- end of "bash-here.reg" --- Next "cygwin.bat" was modified: --- start of "cygwin.bat" --- @echo off C: chdir \Programme\cygwin\bin echo cd %1 | sed -e "s#\(.\):\(.*\)#/cygdrive/\1\2#" -e "s#\\\\#/#g" > %HOMEDRIVE%\.bashcd bash --login -i --- end of "cygwin.bat" --- And last a change to "/etc/profile": --- start of "/etc/profile" --- PATH="/usr/local/bin:/usr/bin:/bin:$PATH" USER="`id -un`" # Set up USER's home directory if [ -z "$HOME" ]; then HOME="/home/$USER" fi if [ ! -d "$HOME" ]; then mkdir -p "$HOME" fi export HOME USER for i in /etc/profile.d/*.sh ; do if [ -f $i ]; then . $i fi done export MAKE_MODE=unix export PS1='\[\033]0;\w\007 \033[32m\]\u@\h \[\033[33m\w\033[0m\] $ ' cd "$HOME" test -f ./.bashrc && . ./.bashrc test -f ./.bashcd && . ./.bashcd && rm -f $HOME/.bashcd --- end of "/etc/profile" --- Since I am using tcsh too, I've done it for tcsh too: --- start of "tcsh-here.reg" --- REGEDIT4 [HKEY_CLASSES_ROOT\Drive\shell\cshHere] @="Shell: tcsh prompt here" [HKEY_CLASSES_ROOT\Drive\shell\cshHere\command] @="C:\\Programme\\cygwin\\bat\\tcsh.bat \"%1\"" [HKEY_CLASSES_ROOT\Directory\shell\cshHere] @="Shell: tcsh prompt here" [HKEY_CLASSES_ROOT\Directory\shell\cshHere\command] @="C:\\Programme\\cygwin\\bat\\tcsh.bat \"%1\"" --- end of "tcsh-here.reg" --- --- start of "tcsh.bat" --- @echo off C: chdir \Programme\cygwin\bin echo cd %1 | sed -e "s#\(.\):\(.*\)#/cygdrive/\1\2#" -e "s#\\\\#/#g" > %HOMEDRIVE%\.bashcd tcsh -l --- end of "tcsh.bat" --- --- start of "/etc/csh.login" --- # # Example /etc/csh.login for Cygwin # unsetenv TEMP unsetenv TMP set path=( /usr/local/bin /usr/bin /bin $path ) if ( ! ${?USER} ) then set user="`id -un`" endif if ( ! ${?HOME} ) then set home=/home/$USER endif if ( ! -d "$HOME" ) then mkdir -p "$HOME" endif if ( ! ${?TERM} || "$TERM" == "unknown" || "$tty" == "conin" ) then set TERM=linux endif setenv MAKE_MODE unix umask 022 cd ~ if ( -f ".bashcd" ) then source ./.bashcd rm -f "$HOME/.bashcd" endif --- end of "/etc/csh.login" --- For W2K cmd.exe it is less complicated. You only need registry settings since it is not neccessary to replace '\' with '/' and substitute 'c:' with '/cygdrive/c' and there is an option telling cmd.exe to execute a commandline given command, then go to interactive mode: --- start of "cmd-here.reg" --- REGEDIT4 [HKEY_CLASSES_ROOT\Drive\shell\DosHere] @="Shell: CMD &prompt here" [HKEY_CLASSES_ROOT\Drive\shell\DosHere\Command] @="C:\\WINNT\\System32\\cmd.exe /k cd \"%1\"" [HKEY_CLASSES_ROOT\Directory\shell\DosHere] @="Shell: CMD &prompt here" [HKEY_CLASSES_ROOT\Directory\shell\DosHere\Command] @="C:\\WINNT\\System32\\cmd.exe /k cd \"%1\"" --- end of "cmd-here.reg" --- Neccessary changes for zsh I leave upto the reader ;-) -- Thomas -- 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/