X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;h=268f05e305b0174675bbefdfd3715b854b90b289;hb=61182b3262baaa532c9f1c4730e255c8e2250ad7;hp=e385f6bb4659552ffe37033dfba6879a4e52897b;hpb=758baa7c72043c44c91c0ba4f1fb7910cd7aa520;p=ghc-hetmet.git diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index e385f6b..268f05e 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -393,10 +393,9 @@ withTerminalReset f = do isTTY <- liftIO $ hIsTerminalDevice stdout if not isTTY then f - else do - oldAttrs <- liftIO $ getTerminalAttributes stdOutput - f - liftIO $ setTerminalAttributes stdOutput oldAttrs Immediately + else gbracket (liftIO $ getTerminalAttributes stdOutput) + (\attrs -> liftIO $ setTerminalAttributes stdOutput attrs Immediately) + (const f) #endif runGHCi :: [(FilePath, Maybe Phase)] -> Maybe [String] -> GHCi ()