Path: utzoo!attcan!uunet!husc6!rutgers!bellcore!faline!thumper!ulysses!kpv
From: kpv@ulysses.homer.nj.att.com (Phong Vo[eww])
Newsgroups: comp.lang.c
Subject: Re: Getchar w/wout echo
Summary: turning off type ahead checking in curses
Message-ID: <10616@ulysses.homer.nj.att.com>
Date: 18 Sep 88 16:42:31 GMT
References: <371@marob.MASA.COM> <225800052@uxe.cso.uiuc.edu> <65197@sun.uucp> <1715@ddsw1.UUCP>
Organization: AT&T Bell Laboratories, Murray Hill
Lines: 17

In article <1715@ddsw1.UUCP>, karl@ddsw1.UUCP (Karl Denninger) writes:
> 
> Why is it that in a terminfo based implementation that the screen does not
> redraw on a "refresh()" call if there are characters stacked by type-ahead?
> 
In many interactive applications (e.g., editors or form/menu systems),
users are not always interested in the intermediate screens,
only in the final screen after a long sequence of typed inputs.
Since these are popular curses applications,
type ahead checking was made the default behavior for curses.

> Is there a work-around for this problem, or a way (other than flushing the
> input) to get the output to appear _now_ when I call refresh()?  I haven't
> been able to find it.
> 
Yes. After initscr(), call typeahead(-1). This turns off the typeahead
checking algorithm (by setting the type ahead file descriptor to -1).