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: latest cygwin: 'run' problem


On 2014-09-06, Gary Johnson wrote:
> On 2014-09-05, Gerry Reno wrote:
> 
> > To clarify this request a bit:
> > 
> > Both run-1.2.0-1 and 1.3.1-1 are broken.  Neither one properly runs a command.
> > The only recent package that actually worked was run-1.3.0-1.
> 
> That has not been my experience.  In my experience, run-1.2.0-1
> works fine but 1.3.0-1 was broken, so I've been "keep"ing 1.2.0-1 on
> my system until I hear that run has been fixed.
> 
> I'm sorry I don't have details on the problem with 1.3.0-1.  It
> would just not work with the commands I was trying to execute.  I
> believe there was some discussion about the issues on this list at
> the time 1.3.0-1 was released.  I'm at home at the moment and away
> from my Windows system so I can't experiment or look at the run
> commands I use.

I wrote a batch file and a shell script to implement a Run Bash Here
feature from the Windows file manager "Send to" context menu, much
like chere but without having to mess with the registry.  The
hardest part was getting the quoting in the run command line right
so that both cmd and bash were happy.  The files are included
in-line below.

When I updated to run-1.3, this stopped working.  That was a year
ago and I don't remember the symptoms exactly:  the window either
briefly appeared or there were no visible indications of the command
running at all.  I fiddled with the quoting for a while and finally
gave up and reverted to run-1.2.

I haven't tried the latest run-1.3.  I want to be sure I can still
revert to run-1.2 if 1.3 doesn't work.  I may be able to try it this
afternoon.

Regards,
Gary

------------------------ run_bash_here.bat -------------------------
@echo off

REM Batch file to run a bash shell in the directory given by the batchfile
REM argument, %1.
REM
REM Gary Johnson
REM 2006-10-17

REM Save the current value of CYGWIN and add the 'noglob' option to allow us
REM to pass the %1 argument to a bash command unchanged.
REM
set cygwin_save=%CYGWIN%
set CYGWIN=%CYGWIN% noglob

REM For the following, also set the Run Bash Here link in SendTo to run in a
REM minimized window to minimize the DOS window flash on startup.
REM
C:\cygwin\bin\run.exe /bin/mintty -e /bin/bash --login -c ". run_bash_here.sh "'%1'" "'%cygwin_save%'
--------------------------------------------------------------------

------------------------- run_bash_here.sh -------------------------
# Run a Cygwin bash interactive shell in a directory according to the
# argument.  If the argument is a directory, run the shell there.  If the
# argument is a file, run the shell in the parent directory.  The argument is
# the full path in Windows format.

# Restore original value of CYGWIN.
#
CYGWIN="$2"

# Convert first argument to a Cygwin path.
#
path=$(cygpath -u "$1")

# If the path is not a directory, remove the last component.
#
if [ -d "$path" ]
then
    dir="$path"
else
    dir="${path%/*}"
fi

cd "$dir"
exec bash -i
--------------------------------------------------------------------


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


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