Getchar w/wout echo

Phong Vo[eww] kpv at ulysses.homer.nj.att.com
Mon Sep 19 02:42:31 AEST 1988


In article <1715 at ddsw1.UUCP>, karl at 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).



More information about the Comp.lang.c mailing list