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: Ctrl-Z fails to suspend Windows programs


> -----Original Message-----
> From: cygwin-owner On Behalf Of John Cooper
> Sent: 15 June 2004 16:12

>  > I don't think there's a reliable enough mechanism by which 
> a shell could
>  > detect one case from the other.
> 
> Below is the code it used to determine if a program is a GUI 
> program or not. I
> don't know how well it works under all conditions; however it 
> did work fine for
> me.

  Well, it doesn't WFM for cygwin binaries.  I used the following command to
determine the Subsystem value from the optional headers for every exe in the
/bin directory of my cygwin installation:

find /bin -type f -name \*.exe -exec echo echo \{\} \&\& objdump
--all-headers \{\} \| grep Subsystem \| grep -v Major \|grep -v Minor \;
>temp.sh

[followed by "chmod u+x temp.sh ; ./temp.sh", of course]

and the only files which show up as "Windows GUI" rather than "Windows CUI"
are checkers.exe, fluid.exe, glpuzzle.exe, ipc-daemon2.exe, mandelbrot.exe,
rubyw.exe and wish84.exe.  So it wouldn't spot my earlier example, insight.

  Then I tried it again on the files in /usr/X11R6/bin.  It only identified
run.exe, Xnest.exe, Xprt.exe and XWin.exe as GUI apps.  That seems like a
way bad false-negative ratio to me.

  However it should be fairly reliable for pure 'doze apps.

> Even if not perfectly reliable, could something like this be 
> added but disabled
> by default?  I for one would find it useful.

  It's a matter for the cygwin bash/zsh maintainers.  On the whole cygwin
apps maintainers tend to prefer not to maintain cygwin-local patches for the
long term, so it's liable to come down to the attitude of the upstreams in
the end.  But the matter is entirely technically feasible.  PTC?


    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


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


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