csh / bsd job control

Barry Shein bzs at cs.bu.edu
Thu Mar 22 00:58:51 AEST 1990


>One bit drudgery in the bsd world whenever writing programs
>(or porting programs to bsd) which manipulate the tty (eg, use
>CBREAK) is adding code to reset the ttystate when stopping
>(eg, ^Z) and set it again when continuing.
>
>Why doesn't the csh keep track of this instead?

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. Sure, we can make stty a built-in, but that
makes it impossible to ever build another program which does this (and
people do this kind of thing more than you might think, such as little
programs or scripts to switch between two tty modes, such as when
using a graphics capable terminal.)

The second most frequent reply you will get is that foosh does just
what you describe (where "foo" is replaced by two or three chars.)

Of course, that doesn't make it a particularly good idea!

It's a hard design problem and given the current state of the world
would probably be better solved by writing a little library routine to
handle what you want rather than re-working the OS.

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

        -Barry Shein

Software Tool & Die    | {xylogics,uunet}!world!bzs | bzs at world.std.com
Purveyors to the Trade | Voice: 617-739-0202        | Login: 617-739-WRLD



More information about the Comp.unix.wizards mailing list