Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!wuarchive!uunet!bria!mike From: mike@bria.UUCP (mike.stefanik) Newsgroups: comp.unix.programmer Subject: Re: Losing pending input in entering RAW or CBREAK Message-ID: <243@bria.UUCP> Date: 4 May 91 04:58:41 GMT References: <5027@lib.tmc.edu> Reply-To: uunet!bria!mike Distribution: usa Organization: MGI Group International, Los Angeles, CA Lines: 36 In an article, dfenyes@thesis1.med.uth.tmc.edu (David Fenyes) writes: |Hello, | |I have an application that enters CBREAK mode (to do editing). |When I switch from cooked to CBREAK, any pending input appears |to be discarded. How can this be avoided or worked around? | |I'm using Coherent. Is this an anomaly, or standard tty behavior? Well, having never progammed under Coherent (and, with God's grace, I won't at any time in the near future :-) I will make the assumption that Coherent uses termio ... with that out of the way ... Are you using curses, or have you written your own? The reason that I ask is that if you are using curses, then you are probably SOL. An excerpt from The Holiest of Tomes: TCSETA set the parameters associated with the terminal from the structure passed as `arg'. The change is immediate TCSETAW wait for the output to drain before setting the new parameters TCSETAF wait for the output to drain and flush the input queue before setting the new parameters It would seem that the ioctl() that is setting the terminal characteristics is using TCSETAF which is forcing the flush on the input queue. If your cbreak is homegrown, then try using TCSETA instead. -- Michael Stefanik, MGI Inc, Los Angeles | Opinions stated are never realistic Title of the week: Systems Engineer | UUCP: ...!uunet!bria!mike ------------------------------------------------------------------------------- If MS-DOS didn't exist, who would UNIX programmers have to make fun of?