Path: utzoo!attcan!uunet!wuarchive!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.questions Subject: Re: BSD vs. SVR4 typehead flush after tty mode change Message-ID: <9851:Oct503:52:1690@kramden.acf.nyu.edu> Date: 5 Oct 90 03:52:16 GMT References: <1990Oct4.213623.27362@smsc.sony.com> Organization: IR Lines: 26 In article <1990Oct4.213623.27362@smsc.sony.com> dce@smsc.sony.com (David Elliott) writes: [ cat /etc/passwd | more > /dev/null flushes tty input on SVR4 ] > Is there an stty setting that will fix this? Under BSD, if your tty is normally in cbreak -echo mode (as some shells prefer), this sort of problem may go away. Smart programs won't change the mode; even for those that do, the tty driver might not flush input for a noop. So I wonder what happens if you use ksh in an editing mode. > Is it just a difference > between the operating systems, or is it a problem with 'more' changing > the tty mode when it shouldn't? Almost certainly the latter, since more shouldn't be talking to the tty at all. > I should also mention that similar things happen when I am getting > out of vi. It's annoying to lose typeahead, and I generally > think a few seconds ahead of myself. I agree. One strategy to fix this, on BSD systems, is to change TIOCSETP to TIOCSETN. On this system the only difference between the calls is between a 32-bit 9 and a 32-bit 10, so it should be easy to find out where to patch the binary. ---Dan