Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!husc6!uwvax!dogie!uwmcsd1!marque!uunet!mcvax!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.unix.questions Subject: Re: Is typeahead loss a generic ksh problem? Message-ID: <486@philmds.UUCP> Date: 25 May 88 10:35:47 GMT References: <8062@elsie.UUCP> <2208@quacky.mips.COM> <7930@brl-smoke.ARPA> Reply-To: leo@philmds.UUCP (L.J.M. de Wit) Organization: Philips I&E DTS Eindhoven Lines: 31 In article <7930@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article <2208@quacky.mips.COM> dce@mips.COM (David Elliott) writes: >>You learn to live without typeahead or without a line editor. I chose >>to live without the editor. > >There is no need for typeahead to be flushed when the terminal handler >mode is changed via ioctl. That is an artifact of the old, creaky >terminal handler most 4BSD-based systems are still saddled with. In >fact it isn't even necessary on modern 4BSD systems; I often type >ahead just after invoking our local screen editor, which definitely >changes terminal modes after my first few characters but does not >lost them. Although the discussion was kind of closed, I would like to make a remark about typeahead, flushing etc. because I have seen nobody mentioning this: From the stty manual page (to give it an 'official' ring *-) : pendin Input is pending after a switch from cbreak to cooked and will be re-input when a read becomes pending or more input arrives (internal state bit). I also have no problems with typeahead flushing (I use the esh which is a Bourne sh with csh features like command line editing with cursor keys etc, foreground/background and other features of the csh). I also use stty new (I think this also sets pending) and although the shell must run in cbreak mode no characters are lost (thanks to 'pendin'). I suggest the originator of the problem uses: stty new; maybe this solves his problem. Leo.