The following program http://hpaste.org/fastcgi/hpaste.fcgi/view?id=8445#a8445
should echo the ASCII code of each character the user types, on the fly, with no line buffering whatsoever. But it doesn't. At least not under Windows's cmd, and even less with msys. Under Windows, I have to press enter before anything is printed to the screen. It then always prints 71 (that's upper G, no idea where that comes from), and then blocks. Pressing enter again prints the codes of all characters typed, except the first one, following by the two codes of the linefeeds. So e.g. when I type "abc" ENTER, I get 71, then hitting ENTER again, I get 98 99 10 10. Under msys, it just ignores both the hSetBuffering and hSetEcho, but when hitting enter, it at least prints the codes correctly. How does it behave under OSX and Linux? Is this a bug or am I doing something wrong?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe