Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: Type-ahead in unix Message-ID: <15783@smoke.brl.mil> Date: 10 Apr 91 05:13:56 GMT References: <15686@smoke.brl.mil> <659@rufus.UUCP> <1991Apr9.112142.13195@robobar.co.uk> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 16 In article <1991Apr9.112142.13195@robobar.co.uk> ronald@robobar.co.uk (Ronald S H Khoo) writes: >Can someone explain how Rob Pike's Plan 9 stuff does *both* echoing >immediately *and* rearranging the display so that the output doesn't >have its appearance ruined? Sounds like the best of both worlds to me .. Presumably it uses much the same scheme as his "mux" (Blit layers multiplexer/terminal emulator). There is an "insertion point" in the stream of characters (including embedded newlines) in a display; anything "behind" the insertion point can be freely edited, and ditto for anything in front of the insertion point, with the special feature that insertion of a newline in front of the insertion point causes everything from the insertion point through the newline to be sent to the underlying process (for "mux", this would be to the UNIX process trying to read input from the layer). All that has to occur to preserve the text after the insertion point is for fresh output to be placed into the display AT the insertion point. Simple?