[project @ 2002-01-28 13:34:10 by simonmar]
authorsimonmar <unknown>
Mon, 28 Jan 2002 13:34:10 +0000 (13:34 +0000)
committersimonmar <unknown>
Mon, 28 Jan 2002 13:34:10 +0000 (13:34 +0000)
Set stdin to unbuffered, so that GHCi doesn't accidentally buffer any
input that might be intended for the program.

ghc/compiler/ghci/InteractiveUI.hs

index bb84229..b09690b 100644 (file)
@@ -1,6 +1,6 @@
 {-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-}
 -----------------------------------------------------------------------------
--- $Id: InteractiveUI.hs,v 1.111 2002/01/28 12:01:12 simonmar Exp $
+-- $Id: InteractiveUI.hs,v 1.112 2002/01/28 13:34:10 simonmar Exp $
 --
 -- GHC Interactive User Interface
 --
@@ -173,6 +173,10 @@ interactiveUI cmstate paths cmdline_libs = do
        Just hval -> writeIORef flush_stdout (unsafeCoerce# hval :: IO ())
        _ -> panic "interactiveUI:stdout"
 
+       -- We don't want the cmd line to buffer any input that might be
+       -- intended for the program, so unbuffer stdin.
+   hSetBuffering stdin  NoBuffering
+
        -- initial context is just the Prelude
    cmstate <- cmSetContext cmstate dflags [] ["Prelude"]