-cbreak on System III

John Nelson john at genrad.UUCP
Tue Aug 21 04:00:22 AEST 1984


> In an old BSD program, I have something that says:
>
>	system("stty cbreak -echo nl");
>
>This allows the user to execute commands with a single keystroke.

System III does not have "cbreak" mode.  Therefore the "stty" program has
changed.  Try using:

	system("stty -icanon -echo -onlcr");

to give you a one-character-at-a-time-mode, and the reverse

	system("stty icanon echo onlcr");

The onlcr is the LF to CR-LF on output flag - similar to but not equal
to the "nl" flag in the original call.  If you want input of a linefeed
to be different than a carriage return, you will also need to set and
reset the "inlcr" flag (I think this is the one!)  Read the MANUAL!



More information about the Comp.unix.wizards mailing list