pty/fork and SIGINT

Brian Sturk bsturk at news.rcn.com
Mon Dec 17 22:43:48 EST 2001


I'm using the pty module to to "control" a shell process
and I'm having a hard time getting SIGINT to be sent to
the processes spawned within it, i.e. ping <hostname>.

I've tried registering a handler via signal.signal and externally
sending it SIGINT with the pid returned from fork() using kill, 
and also using the returned pid from fork() to send it a signal.SIGINT
from within the script.  Nothing I've tried seems to work.

The script is a little large to post here but it basically
is run within the editor vim so there are a few variables at work.
I'm wondering if the problem is that I'm never returning control 
to the editor since I continually have data to be read().  I'm not
a signal/process guru so I'm unsure where to look. 

Any pointers/help would be great...

-- 
.-----------------------------------------------------,-------.  
| Brian M. Sturk - http://www.nh.ultranet.com/~bsturk \ C/C++ |  .>   )\,^a__
|--------------------------|  bsturk at nh.ultranet.com   | Java | (  _ _)/ /-." ~
| http://www.telengard.com `---------------------------`------|  `( )_ )/
| Telengard Technologies Inc. -  NT/*nix UI & device drivers  | _<_s_<_s
'-------------------------------------------------------------'



More information about the Python-list mailing list