#2189: hSetBuffer stdin NoBuffering doesn't seem to work in ghc 6.8.2 on Windows
XP
-----------------------------------------------+----------------------------
    Reporter:  FalconNL                        |       Owner:         
        Type:  bug                             |      Status:  new    
    Priority:  normal                          |   Component:  GHCi   
     Version:  6.8.2                           |    Severity:  normal 
    Keywords:  hsetbuffering buffering buffer  |    Testcase:         
Architecture:  x86                             |          Os:  Windows
-----------------------------------------------+----------------------------
 The following program repeats inputted characters until the escape key is
 pressed.


 {{{
 import IO
 import Monad
 import Char

 main :: IO ()
 main = do hSetBuffering stdin NoBuffering
           inputLoop

 inputLoop :: IO ()
 inputLoop = do i <- getContents
                mapM_ putChar $ takeWhile ((/= 27) . ord) i
 }}}


 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.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2189>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to