X-Spam-Check-By: sourceware.org
Date: Wed, 18 Oct 2006 18:31:38 -0700
From: Gary Johnson <garyjohn@spk.agilent.com>
To: cygwin@cygwin.com
Subject: Re: BashHere.reg Explorer add-on and long filenames
Message-ID: <20061019013138.GB17082@suncomp1.spk.agilent.com>
Mail-Followup-To: cygwin@cygwin.com
References: <1161206400.10364.24.camel@mercury.sprymusic>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1161206400.10364.24.camel@mercury.sprymusic>
User-Agent: Mutt/1.5.12 (2006-07-14)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 2006-10-18, Jean-Claude Gervais <jc.gervais@videotron.ca> wrote:
> Hello List!
> 
> I found and adapted a Windows registry hack to permit opening Bash
> prompts in any folder in Explorer by right-clicking on the folder and
> selecting the "Open with Cygwin Shell (bash)" menu entry.
> 
> It works fine, but for some strange reason, whenever a folder is
> selected that has a long-name (ie. not 8.3 DOS standard), the bash
> prompt displays the short filename version of the path.
> 
> Is there a way to get it to display the long version?
> 
> Here is the .REG file in case anyone else would like to give this a try.
> 
> TIA, J
> 
> .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> 
> Windows Registry Editor Version 5.00
> 
> [HKEY_CLASSES_ROOT\Directory\shell\Custom_OpenWithCygwinShell]
> @="Open with Cygwin Shell (bash)"
> 
> [HKEY_CLASSES_ROOT\Directory\shell\Custom_OpenWithCygwinShell\command]
> 
> @="c:/cygwin/bin/bash --login -c \"cd '%1'; exec bash --noprofile --norc
> -i\""
> 
> [HKEY_CLASSES_ROOT\Drive\shell\Custom_OpenWithCygwinShell]
> 
> @="Open with Cygwin Shell (bash)"
> 
> [HKEY_CLASSES_ROOT\Drive\shell\Custom_OpenWithCygwinShell\command]
> 
> @="c:/cygwin/bin/bash --login -c \"cd '%1'; exec bash --noprofile --norc
> -i\""
> 
> .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

You can use 'cygpath' to translate among the various forms of a path 
name.  In this case, the idea would be to replace

    cd '%1'

by something like

    cd "`cygpath -u '%1'`"

I still have a hard time getting the quoting right in these 
situations, though, so you may have to play with that a bit.  Some 
sort of quoting surrounding the argument to 'cd' is necessary so 
that paths containing spaces will appear to 'cd' as a single 
argument.

HTH,
Gary

-- 
Gary Johnson                 | Agilent Technologies
garyjohn@spk.agilent.com     | Wireless Division
                             | Spokane, Washington, USA

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

