chas@ihuxe.UUCP (Charles Lambert) (03/21/85)
I noticed some discussion of the "Berkleyism" CBREAK, recently. I ran into this beastie whilst trying to port the infamous HACK sources onto System 5. Fortunately, with a copy of 4.2 BSD Programmers Manual to hand, I gleaned the following information: If the CBREAK flag is set, the terminal input behaves in "half- cooked" (as opposed to raw) mode. I understand this to mean that each character is normally returned as soon as it is typed (non- canonical, no line editing) BUT the BREAK and INTERRUPT signals are still processed. In the new arrangement of terminal controls, the matters of canonical input and signal interception are controlled by separate flags. Thus, the equivalent of CBREAK seems to be: (ISIG | ~ICANON) Haven't verified this yet, just a (hopefully helpful) suggestion. Charlie Lambert AT&T Bell Labs Naperville, IL.
guy@rlgvax.UUCP (Guy Harris) (03/22/85)
> I noticed some discussion of the "Berkleyism" CBREAK, recently. ... > In the new arrangement of terminal controls, the matters of canonical input > and signal interception are controlled by separate flags. Thus, the > equivalent of CBREAK seems to be: > > (ISIG | ~ICANON) This is correct. CBREAK in the V7 terminal driver (and in the enhanced V7 driver that comes with Berkeley systems) is, in effect, the negation of ICANON in the System III/V terminal driver.
mark@cbosgd.UUCP (Mark Horton) (03/23/85)
Well, almost. While clearing ICANON is similar to setting CBREAK, you also have to set VMIN and VTIME (two of the c_cc values, they overlap two other perfectly useful characters) to 1 when going into CBREAK mode. Of course, save the old ones so you can restore them later. If you forget to set these to 1, the symptom is that it only wakes up every 4 characters you type (since one of the characters that is overlayed is your EOF character, control D.) Mark