X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fghci%2FGhciMonad.hs;h=7720b84d59e336ecfe566e5f94d735101501ad6d;hp=dc16f25549b2957a27e1f09ddf50f8a0dda09acf;hb=b47555c3c6e7d9b6cbe17714fee9fd22d1779928;hpb=2f330af4eeeae4562d9ea9eeaec7571901481f8c diff --git a/compiler/ghci/GhciMonad.hs b/compiler/ghci/GhciMonad.hs index dc16f25..7720b84 100644 --- a/compiler/ghci/GhciMonad.hs +++ b/compiler/ghci/GhciMonad.hs @@ -77,7 +77,8 @@ data GHCiState = GHCiState -- were supposed to be in the context but currently had errors, -- but this was complicated. Just replaying the :module commands -- seems to be the right thing. - virtual_path :: FilePath + virtual_path :: FilePath, + ghc_e :: Bool -- True if this is 'ghc -e' (or runghc) } data CtxtCmd @@ -251,10 +252,11 @@ printTimes allocs psecs ----------------------------------------------------------------------------- -- reverting CAFs -revertCAFs :: IO () +revertCAFs :: GHCi () revertCAFs = do - rts_revertCAFs - turnOffBuffering + io $ rts_revertCAFs + s <- getGHCiState + when (not (ghc_e s)) $ io turnOffBuffering -- Have to turn off buffering again, because we just -- reverted stdout, stderr & stdin to their defaults.