GHC: Ticket Queryhttp://ghc.haskell.org/trac/ghc/query?status=!closed&cc=~camio&desc=1&order=priority
The Glasgow Haskell Compileren-USGHChttp://ghc.haskell.org/trac/ghc/chrome/site/ghc_logo.pnghttp://ghc.haskell.org/trac/ghc/query?status=!closed&cc=~camio&desc=1&order=priority
Trac 1.0.1http://ghc.haskell.org/trac/ghc/ticket/2189
http://ghc.haskell.org/trac/ghc/ticket/2189#2189: hSetBuffering stdin NoBuffering doesn't work on WindowsMon, 31 Mar 2008 21:22:42 GMTFalconNL<p>
The following program repeats inputted characters until the escape key is pressed.
</p>
<pre class="wiki">import IO
import Monad
import Char
main :: IO ()
main = do hSetBuffering stdin NoBuffering
inputLoop
inputLoop :: IO ()
inputLoop = do i &lt;- getContents
mapM_ putChar $ takeWhile ((/= 27) . ord) i
</pre><p>
Because of the "hSetBuffering stdin NoBuffering" line it should not be necessary to press the enter key between keystrokes. This program works correctly in WinHugs (sep 2006 version). However, GHC 6.8.2 does not repeat the characters until the enter key is pressed. The problem was reproduced with all GHC executables (ghci, ghc, runghc, runhaskell), using both cmd.exe and command.com on Windows XP Professional.
</p>
Resultshttp://ghc.haskell.org/trac/ghc/ticket/2189#changelog