csh / bsd job control

karl_kleinpaste at giza.cis.ohio-state.edu karl_kleinpaste at giza.cis.ohio-state.edu
Thu Mar 22 05:01:33 AEST 1990


bzs at cs.bu.edu writes:
   The reply I'm sure you'll hear most is, then how would a program like
   'stty' ever work? You'd have to layer more magic to stop the csh from
   undoing what stty does.

Not really...

   I'd be curious to hear how those shells that do this handle the stty
   problem.

The SysV csh I built took care of the problem reasonably trivially.
When a job _stopped_, csh would restore the tty state it knew before
the job was started.  When the job was restarted, csh would re-assert
the tty state it had when the job last stopped.

When a job _ended_, the tty state was not messed with, on the
assumption that the job knew what it was doing if it changed things.

stty works fine on this basis.  And things like Emacs and vi could be
stopped without causing confusion.

It was very useful to be simulating job control in a non-job-control
environment when dealing with this problem, since I had to assume that
the job had no clue whatever that it might possibly be stopped; csh's
interaction with such stuff had to be completely transparent.

--karl



More information about the Comp.unix.wizards mailing list