[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Does anyone understand terminal job control?



On Sun, Feb 08, 2009 at 08:27:09PM -0800, Daniel Burrows wrote:
> On Sun, Feb 08, 2009 at 07:58:51AM -0500, "Douglas A. Tutty" <dtutty@vianet.ca> was heard to say:
 
> > Perhaps your controller program will have
> > to be a filter between the process and the terminal: pipe its std-in an
> > std-out to the controller process and the controller process issue the
> > appropriate shell start/stop commands as necessary while leaving the
> > process in the background the whole time.
> 
>   I thought about this option, but the problem is detecting when the
> subprocess is trying to read (but I don't have anything to give it).
> One interesting idea I got from the libc manual (but have yet to follow
> up on) is to inject a VDSUSP character into the stream -- apparently
> this will suspend the process, but only when the character is actually
> read.  I vaguely recall having some reason to think it might not work,
> but it's worth at least trying.  (as it happens, since I control the
> terminal, I don't need a man in the middle to do this (I think) -- I
> can just ask the terminal to send the character)
> 

Wouldn't the process that is wanting to read from stdin from a user
typically issue some sort of prompt for the user.  If your controlling
program wasn't there, how would the user know that input was requried?
Can't you listen for that prompt?

Doug.


Reply to: