This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [INFO] Adding "Cygwin here" to Windows Explorer

Henry S. Thompson schrieb:
1) In the registry entry:

C:\cygwin\bin\rxvt.exe -fn 'Lucida Console-11' -geometry 80x48 -sl 300 -cr '#8b4513' -bg '#fffff0' -e /usr/bin/bash -c "XXX=\"%1\" bash --login -i"

2) In my .bash_profile

  if [[ "x$XXX" != "x" ]]
    cd "$XXX"
    unset XXX

This is a moderately embarassing/messy hack -- can anyone do better?

I use a similar scheme since the good old b20 days.
Just not with the XXX name and not with a subshell.
(I put the $PWD arg into a temp file in the cygwin.bat starter, which I pickup at .profile)
And not for the Explorer (which I don't use), but for a TotalCmd button. To open some shell like bash, rxvt, ksh, 4nt in the current dir (optinally specified by some dir arg).
A keyboard shortcut is also useful.

And I also apply a lot of path unification then, to shorten
the windows path (where I use subst) to the optimal cygwin path
(where I have symlinks)

case $PWD in
/cygdrive/r/PERL* )
cd `echo $PWD | sed -e 's!/cygdrive/r/PERL!/usr/src/perl!'`
/cygdrive/r/gnu/cygwin* )
cd `echo $PWD | sed -e 's!/cygdrive/r/gnu/cygwin!/usr/src!'`
/cygdrive/r/gnu* )
cd `echo $PWD | sed -e 's!/cygdrive/r/gnu!/usr/src/gnu!'`
/cygdrive/r/lisp* )
cd `echo $PWD | sed -e 's!/cygdrive/r/lisp!/usr/src/lisp!'`
/cygdrive/p/CORMAN* )
cd `echo $PWD | sed -e 's!/cygdrive/p/CORMAN~1/CORMAN~1.5!/usr/src/lisp/corman!'`
/cygdrive/r/php* )
cd `echo $PWD | sed -e 's!/cygdrive/r/php!/usr/src/php!'`
/cygdrive/n/* )
cd `echo $PWD | sed -e 's!/cygdrive/n/!/!'`
/cygdrive/v/* )
cd `echo $PWD | sed -e 's!/cygdrive/v!/www!'`
/f/data/mp3/* )
cd `echo $PWD | sed -e 's!/f/data/mp3/!/music/!'`

Reini Urban

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]