RE: Cannot get ^Z to suspend a program

2003-02-12 Thread [EMAIL PROTECTED]
Job control and signals for Cygwin processes are areas pretty 
internal to Cygwin.  they are also pretty complex.  IMO, it's 
hard to talk much about adding some feature to them without the 
context of what's already there.  If you can put your suggestions 
in that context, I expect you'll get better feedback.  Even if that's 
not the case, you'll be in a better position to evaluate your own 
ideas given the current architecture.

Just my $.02.

Larry

Original Message:
-
From: linda w \(cyg\) [EMAIL PROTECTED]
Date: Tue, 11 Feb 2003 21:18:05 -0800
To: [EMAIL PROTECTED]
Subject: RE: Cannot get ^Z to suspend a program


 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/



mail2web - Check your email from the web at
http://mail2web.com/ .



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




RE: Cannot get ^Z to suspend a program

2003-02-12 Thread linda w \(cyg\)

 Job control and signals for Cygwin processes are areas pretty 
 internal to Cygwin.  they are also pretty complex.  IMO, it's 
 hard to talk much about adding some feature to them without the 
 context of what's already there.  If you can put your suggestions 
 in that context, I expect you'll get better feedback.  Even if that's 
 not the case, you'll be in a better position to evaluate your own 
 ideas given the current architecture.
---
I'm familiar with that logic, however, in a 'design' phase,
it's sometimes useful to forget about what is and only look at
the end result of what is wanted.  If one limits one's thinking
based on the current design, one might never come up with ideas that
would be precluded by the current design.

It's more of a wish list exercise than a request to actually
go fix something so that if someone was working on those areas or
did in the not too distant future, they could, perhaps, be mindful
of what might be, desirable, behavior.

It's like that saying about when your are up to your neck
in alligators, its difficult to remember that your original objective
was to drain the swamp. :-)

-l


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




RE: Cannot get ^Z to suspend a program

2003-02-11 Thread linda w \(cyg\)
 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/




Re: Cannot get ^Z to suspend a program

2003-02-10 Thread Christopher Faylor
On Mon, Feb 10, 2003 at 10:26:36AM -0800, Samir Gupta wrote:
I am using cygwin under windows xp pro and under windows 2000 pro, and
cannot get the ^Z to suspend a program that I have opened.  note that I
normally use tcsh, but I also experience the same problem using bash...

Can't duplicate it here.  If I set CYGWIN=tty prior to starting bash and
then type:

c:\bash
bash$ sleep 20
bash$ CTRL-Z

it suspends the sleep.

cgf

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




Re: Cannot get ^Z to suspend a program

2003-02-10 Thread Samir Gupta
thanks for the reply:

I was trying to use CTRL-Z after opening up a windows program (such as emacs
-- the windows version or excel)

Suspend will work if I perform it on the sleep command.
1 sleep 20

Suspended
2

Why won't it suspend If I type the following:

1 emacs 
[1] 1668
2 emacs

The first command opens up my emacs (for windows) program and runs it in the
background (so I can still use the prompt).
So, I assume if this capability is there, then it should also be able to put
it in the background after I have already opened it.
However, when I type the second command, I can't use CTRL-Z to put it in the
background.
Do you know why this is?


Can't duplicate it here.  If I set CYGWIN=tty prior to starting bash and
then type:

c:\bash
bash$ sleep 20
bash$ CTRL-Z

it suspends the sleep.

cgf

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




Re: Cannot get ^Z to suspend a program

2003-02-10 Thread Rolf Campbell
Samir Gupta wrote:

thanks for the reply:

I was trying to use CTRL-Z after opening up a windows program (such as emacs
-- the windows version or excel)


Cygwin cannot control how windows programs handle CTRL+Z.



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




RE: Cannot get ^Z to suspend a program

2003-02-10 Thread linda w \(cyg\)
Perhaps silly question, but, why not?

 Cygwin cannot control how windows programs handle CTRL+Z.

I have programs that seem to intercept keyboard keys for use as hotkeys.
Couldn't cygwin do something similar?

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




Re: Cannot get ^Z to suspend a program

2003-02-10 Thread Rolf Campbell
linda w (cyg) wrote:

Perhaps silly question, but, why not?



Cygwin cannot control how windows programs handle CTRL+Z.



I have programs that seem to intercept keyboard keys for use as hotkeys.
Couldn't cygwin do something similar?

curious...
-linda

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.



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



RE: Cannot get ^Z to suspend a program

2003-02-10 Thread Rolf Campbell

As I understand it, 'cygwin' does not kill the program, the program
kills itself on Ctrl+C.

PS: please do not respond to me personally.

 -Original Message-
 From: Samir Gupta [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, February 10, 2003 8:39 PM
 To: Rolf Campbell
 Subject: RE: Cannot get ^Z to suspend a program
 
 
 But why can Cygwin kill the program when you type CTRL+C?
 
 
 -Original Message-
 From: Rolf Campbell [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 10, 2003 5:13 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Cannot get ^Z to suspend a program
 
 
 Samir Gupta wrote:
  thanks for the reply:
  
  I was trying to use CTRL-Z after opening up a windows 
 program (such as
 emacs
  -- the windows version or excel)
 
 Cygwin cannot control how windows programs handle CTRL+Z.
 
 
 
 --
 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/
 

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