Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: termios question, PENDIN option Message-ID: <20869@mimsy.umd.edu> Date: 21 Nov 89 21:41:41 GMT References: <2057@ncr-sd.SanDiego.NCR.COM> <2640@auspex.auspex.com> Distribution: usa Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 35 In article <2640@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >... So, to fix this, [tcsh]: > 1) it sends a CR to the terminal, to zip the cursor back > to column 0; > 2) reprints the prompt; > 3) pushes the characters back, still with echoing off; > 4) sets the PENDING flag, so that those characters will > be "retyped", this time with echoing on. Of course, instead of all this insanity, it could simply: 1) send CR; 2) reprint the prompt; 3) push the characters back WITH ECHO ENABLED. This would cut down on the number of system calls. (Of course, if the machine is heavily loaded or otherwise slow, and you type something while the characters are being `pushed back', what you typed will come out in the middle of the pushed-back characters, no matter what method is used to push them back. That is, the sequence of events will be: to push back `hello world': TIOCSTI('h') raw queue now `h' TIOCSTI('e') raw queue now `he' TIOCSTI('l') raw queue now `hel' input interrupt: `f' raw queue now `helf' TIOCSTI('l') raw queue now `helfl' . . . This routinely happens to me in ucb mail, which uses TIOCSTI for header editing. It is extremely annoying.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris