Ulrich Lauther wrote:
> VC++ provides the functions _getch() and _getche() for reading
> one character from stdin without buffering, i.e., one gets the
> character without having to press the enter key.
> This works fine in a DOS-window, but not from a MSYS (rxvt?)
> I assume the problem is related to the "feature" that
> fflush(stdout) is needed to show output, ...
I believe your assumption to be correct; this issue has been
discussed to death, on this very list, in the past. Earnie has
tried hard to find a solution, without success.
> ... however, fflush(stdin) doesn't help.
Naturally. All fflush() on *any* input stream achieves is to
discard any pending data from the input buffer.
> Is there a way around this problem?
Probably not the one that you want to hear, but the one that I
myself have adopted -- run MSYS in a native Windoze console;
(either start it with the --norxvt switch, or rename/delete
rxvt.exe in/from your msys/1.0/bin directory, before you start
the session). You will lose the job control features, and you
must use Ctrl-Z as an EOF signal, rather than Ctrl-D.