Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uunet!xstor!iverson From: iverson@xstor.UUCP (Tim Iverson) Newsgroups: comp.unix.xenix Subject: Re: CBREAK on SCO XENIX Message-ID: <192@xstor.UUCP> Date: 24 Jul 90 19:39:41 GMT References: <1990Jul06.094023.21756@pemstgt.gtc.de> <269e591d-5c1.1comp.unix.xenix-1@vpnet.chi.il.us> <173@n4hgf.Mt-Park.GA.US> Reply-To: iverson@xstor.UUCP (Tim Iverson) Organization: Storage Dimensions, Inc. Lines: 34 In article <173@n4hgf.Mt-Park.GA.US> wht@n4hgf.UUCP (Warren Tucker) writes: >> [paraphrased] What's CBREAK? What's the UNIX equivilant for it? > >CBREAK may be found but it is also unsupported :-). >It is a "half-cooked" mode found in BSD. CBREAK made it into >XENIX sgtty.h, but I have never been able to get it to work. It's used mostly to unbuffer tty input so that programs can get a key as it is typed (e.g. rn, emacs, vi, jove, etc. all use cbreak mode or its equivilent). Under Xenix, support for this is provided via the termio library calls as follows (see the termio manual entry for details): { struct termio t; int gotkey; char key; /* NB - on a real implementation, you should also * save the current setting to restore before you leave. */ ioctl(0, TCGETA, &t); /* get current settings */ t.c_iflag &= ~ICANON; /* turn off editing & line buffering */ t.c_cc[VMIN] = 1; /* return at least 1 char, */ t.c_cc[VTIME] = 0; /* but don't wait for more chars */ ioctl(0, TCSETA, &t); gotkey = read(0, key, 1) == 1; /* get just one key */ } >Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US >"It was electrons that brought down the Berlin Wall." -- Timothy Leary - Tim Iverson uunet!xstor!iverson