Path: utzoo!attcan!uunet!timbuk!cs.umn.edu!uc!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!rutgers!bagate!cbmvax!ag From: ag@cbmvax.commodore.com (Keith Gabryelski) Newsgroups: comp.unix.questions Subject: Re: BSD vs. SVR4 typehead flush after tty mode change Message-ID: <15042@cbmvax.commodore.com> Date: 10 Oct 90 16:56:01 GMT References: <10704@uudell.dell.com> <14028@smoke.BRL.MIL> Reply-To: ag@cbmvax.commodore.com (Keith Gabryelski) Organization: Commodore-Amiga Unix; West Chester, PA Lines: 30 In article <14028@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >In article <10704@uudell.dell.com> jrh@mustang.dell.com (James Howard) writes: >>I think you must have something wrong on your particular >>version of V.4, or maybe the shell you're running. > >My bet would be that "more" was improperly ported, >and that a "flushing" tty ioctl was used in the port. No. There is a bug in SysVr4 streams tty module `ldterm' that flushes the stream if ICANON is turned on. This effectively disables typeahead in shells that turn on ICANON when leaving edit mode (ie ksh in emacs mode). The fix: *** ldterm.c- Wed Oct 10 12:39:58 1990 --- ldterm.c Wed Aug 15 17:30:29 1990 *************** *** 3162,3168 **** --- 3162,3170 ---- */ if (tp->t_modes.c_lflag & ICANON) { DEBUG4 (("CHANGING TO CANON MODE\n")); + #ifdef FLUSH_IF_ICANON_TWEAKED (void) putctl1(q->q_next, M_FLUSH, FLUSHR); + #endif optbuf.so_flags = SO_READOPT|SO_MREADOFF; optbuf.so_readopt = RMSGN;