www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/12/00:19:08

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "linda w \(cyg\)" <cygwin AT tlinx DOT org>
To: <cygwin AT cygwin DOT com>
Subject: RE: Cannot get ^Z to suspend a program
Date: Tue, 11 Feb 2003 21:18:05 -0800
Message-ID: <000701c2d256$1fbf0cf0$1403a8c0@sc.tlinx.org>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
In-Reply-To: <b29khi$iah$1@main.gmane.org>

> Sure, but those programs hook the key(s) in a global fashion, 
> not just 
> from individual programs.  So, Cygwin could hook the Ctrl+Z key, but 
> what would it do then, how would it know which process to suspend?
> 
> I'm not sure that cygwin could 'suspend' a non-cygwin process 
> even if it 
> wanted to.
---
	started playing around with this...I note:

> cygjob& kill -STOP %1	#works as expected
	but
> winprog& kill -STOP %1 #laughs at my puny attempts to stop it

	So cygjobs seem to be suspendable but winjobs are already 
not playing fair!

now I try this:
> while :; do sleep 3; echo 1;done   # control-z ignored

Also, though, I note that if I type while the program is running, say
"ls", then press control-c, "ls" still executes!

Under lnx, I see the 'ls' characters echoed as soon as I type them --
it appears "readline" is running "in foreground" even though I have
a "job" (the while loop) running in foreground as well.  It's "like"
even when a foreground job is running, there is a 2nd, system level
process that also runs and processes key presses (allowing processing
control-u and control-r, among other, readline functions).

It _seems_ like to get similar functionality on cygwin, one might
have to have the same -- perhaps a unix-like fork/exec/wait would
translate, internally, to a windows "fork/exec/select", where select
waits for keyboard input or the child process to end.  Then the win-parent
process -- still in control, could process line editing and user-job
control key presses -- since we know that, at least, cygwin programs
are "well behaved" in regards to "respecting" a "kill -STOP", the
win-parent "keyboard monitor thread" could use the same means to
STOP a child.

As for job control of winjobs?  Guess that'd be another whole pain
in the butt.  Though maybe if the running user has 'debug' privs, they
could attach the process and suspend it that way?  (Dunno)  If their 
could be some way of suspending winjobs, though, then the above 'keyboard
thread' method could be used to implement job control.

Wha'd'ya think?
-linda




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019