Re: Problems starting "rxvt" from startxwin.bat

2009-09-03 Thread Charles Wilson
Jon TURNEY wrote:

> Is there a reason why we can't do 'checkx -d %DISPLAY% -t 30' rather
> than counting up to 30 ourselves?

Well, -t with a number larger than 12 is not useful. Xlib itself will
timeout after 12 seconds if it can't contact the xserver.  The -t option
for checkx (and run2) simply says how long checkx will wait for the
worker thread that's actually trying to contact the Xserver, before
giving up and detaching the thread.

--
Chuck


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



Re: Problems starting "rxvt" from startxwin.bat

2009-09-03 Thread Jon TURNEY

On 01/09/2009 12:58, Phil Betts wrote:

Jose Luis wrote:

I can start "xterm" from startxwin.bat:

 %RUN% xterm -e /usr/bin/bash -l

but no "rxvt":

 %RUN% rxvt -bg white -fg black -e /bin/bash

although it can be started from command line:

  jlfd...@jlfdiazwxp ~
  $ rxvt -bg white -fg black -e /bin/bash&


Why does rvxt starting from startxwin.bat fail?


This is almost certainly a timing issue.  The line in the batch file
that starts the server uses %RUN% to start it in the background.  This
means that the following commands in the batch file may execute before
the X server has completed (or even started) its initialisation.


Argh, yes.


I suspect that the reason the two terminals behave differently is
that, xterm tries to connect to the server a number of times before
giving up, whereas rxvt gives up at the first failure.

Because the time taken to initialise the X server can vary, rather
than using just sleep, I have added the following:

REM wait up to 30 seconds for the X server
set /a COUNT=0
:WAITFORX
   checkx -d %DISPLAY%
   if not errorlevel 1 goto FINISHOFF
   set /a COUNT+=1
   if %COUNT% GEQ 30 goto NOX
   echo Waiting for X on display %DISPLAY% ...
   sleep 1
goto WAITFORX

:NOX
echo WARNING: X doesn't appear to have started
exit /B 1   

:FINISHOFF


Jon/Yaakov, could this be added to the distributed startxwin.bat?
Perhaps the warning could be extended to include instructions to
check the log.


Yes, this needs fixing.

But DOS batch scripts make me sad, so I was thinking that I could just replace 
the contents of startxwin.bat with something like "%RUN% startxwin.sh"


Is there a reason why we can't do 'checkx -d %DISPLAY% -t 30' rather than 
counting up to 30 ourselves?


This also adds run2 as a dependency of the xinit package which owns these 
scripts.

--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

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



RE: Problems starting "rxvt" from startxwin.bat

2009-09-01 Thread Mike Ayers
> From: cygwin-xfree-ow...@cygwin.com [mailto:cygwin-xfree-
> ow...@cygwin.com] On Behalf Of Phil Betts

> Jose Luis wrote:
> > I can start "xterm" from startxwin.bat:
> >
> > %RUN% xterm -e /usr/bin/bash -l
> >
> > but no "rxvt":
> >
> > %RUN% rxvt -bg white -fg black -e /bin/bash
> >
> > although it can be started from command line:
> >
> >  jlfd...@jlfdiazwxp ~
> >  $ rxvt -bg white -fg black -e /bin/bash  &

Brutality is fun!

%RUN% xterm -e "sh -c '(nohup rxvt -bg white -fg black -e /bin/bash &) && sleep 
1'"


HTH,

Mike



RE: Problems starting "rxvt" from startxwin.bat

2009-09-01 Thread Phil Betts
Jose Luis wrote:
> I can start "xterm" from startxwin.bat:
> 
> %RUN% xterm -e /usr/bin/bash -l
> 
> but no "rxvt":
> 
> %RUN% rxvt -bg white -fg black -e /bin/bash
> 
> although it can be started from command line:
> 
>  jlfd...@jlfdiazwxp ~
>  $ rxvt -bg white -fg black -e /bin/bash  &
> 
> 
> Why does rvxt starting from startxwin.bat fail?

This is almost certainly a timing issue.  The line in the batch file
that starts the server uses %RUN% to start it in the background.  This
means that the following commands in the batch file may execute before
the X server has completed (or even started) its initialisation.

I suspect that the reason the two terminals behave differently is
that, xterm tries to connect to the server a number of times before
giving up, whereas rxvt gives up at the first failure.

Because the time taken to initialise the X server can vary, rather
than using just sleep, I have added the following:

REM wait up to 30 seconds for the X server
set /a COUNT=0
:WAITFORX
  checkx -d %DISPLAY%
  if not errorlevel 1 goto FINISHOFF
  set /a COUNT+=1
  if %COUNT% GEQ 30 goto NOX
  echo Waiting for X on display %DISPLAY% ...
  sleep 1
goto WAITFORX

:NOX
echo WARNING: X doesn't appear to have started
exit /B 1

:FINISHOFF


Jon/Yaakov, could this be added to the distributed startxwin.bat?
Perhaps the warning could be extended to include instructions to
check the log.

Phil
-- 


This email has been scanned by Ascribe Ltd using Microsoft Antigen for Exchange.

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