"Bash Here..." menu option "howto" reg-entry

Linda Walsh cygwin@tlinx.org
Tue Nov 14 09:50:00 GMT 2006


Yes...it requires installing a separate executable program.

This "add bash prompt" requires no 3rd party binary and
uses programs already included in the cygwin base package.

The installable program also has a bug in that it invokes each
shell window as a separate user login, breaking the normal
windowing paradigm of one login (starting an X-server, for
example), followed by multiple client windows (that don't get
started as login windows).

Why install extra programs when it can all be done by adding
2 registry keys (1 for directories, 1 for drives)?

linda


Hugh McMaster wrote:
> Hi Linda,
>
> Just a quick note.  In the setup programme, there is an option to have
> 'Open Bash Prompt Here' context menu added to the right-click menu.
>
> Hugh
>
>
> On 11/11/06, Linda Walsh wrote:
>> After some time debugging I figured out a way to add a prompt option
>>
>> to the right-click menu on directories and drives that works for
>> my alternate drives and network directories.  I think it should be
>> able to be generalized for other shells, but I use "Bash".
>>
>> The reg-entry for directories is:
>> REGEDIT4
>>
>> [HKEY_CLASSES_ROOT\Directory\shell\Bash Here...]
>>
>> [HKEY_CLASSES_ROOT\Directory\shell\Bash Here...\Command]
>> @="C:\\bin\\ash.exe -c 'PATH=\"/bin:$PATH\"; test -z \"$SHELL\" &&
>> SHELL=C:\\\\bin\\\\bash.exe;  cd \"%L\"; cygstart -d \"$PWD\" 
>> \"$SHELL\"'"
>>
>> ---(note, last line starting with "@" is all 1 line)
>> Assumptions:
>> 1) Cygwin Drive Prefix=/    #(mount -c '/')
>> 2) Cygwin's directories are same under Cygwin and NT
>>    (cygwin not installed in a subdir)
>>
>> It also uses "ash.exe", "test.exe" and "cygstart.exe", which
>> I believe are part of the base distribution.
>>
>> Viewing a CD/DVD in drive E:, root dir, - right-click(menu),
>>    Pick "Bash Here...", brings up a bash-command window with
>>    current dir = "/e/<dirname>
>>
>> UNC pathnames show up as one would expect:
>>    //"sharename"/"dirname"
>>
>> Advantages over other known methods:
>>
>> 1) no external programs required;
>> 2) no "stacked" shell processes left in process table
>>
>> Maybe the registry entries could go in a Cygwin FAQ entry?
>>
>
> -- 
> 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/
>

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



More information about the Cygwin mailing list