Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbjade.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!ucbjade!ucbtopaz!cnrdean From: cnrdean@ucbtopaz.BERKELEY.EDU Newsgroups: net.unix-wizards Subject: cbreak solution and wonderment Message-ID: <323@ucbjade.BERKELEY.EDU> Date: Thu, 13-Feb-86 21:39:24 EST Article-I.D.: ucbjade.323 Posted: Thu Feb 13 21:39:24 1986 Date-Received: Sat, 15-Feb-86 03:25:19 EST Sender: network@ucbjade.BERKELEY.EDU Reply-To: cnrdean@ucbtopaz.BERKELEY.EDU () Organization: University of California, Berkeley Lines: 22 Thank you ALL for your help with my cbreak problem. The consensus was to use the setbuf (example below). But, what is interesting is that if I issue the command: system("stty cbreak -echo nl"); Output is unbuffered automatically. That is, I can use putchar(); Sam Scalise ************************************************************* Sample using setbuf: struct sgttyb rawmode; /* Controlling tty raw mode */ gtty(0,&rawmode); /* restore it later */ rawmode.sg_flags |= (CBREAK); rawmode.sg_flags &= ~(ECHO|XTABS|CRMOD); stty(0,&rawmode); /* Put tty in raw mode */ ---> setbuf(stdout,NULL);