X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;fp=compiler%2Fghci%2FInteractiveUI.hs;h=268f05e305b0174675bbefdfd3715b854b90b289;hp=e385f6bb4659552ffe37033dfba6879a4e52897b;hb=032287cbc4b56312588388c324731005bd3eee77;hpb=e47c481d3e69601d902ce525f54de9246a80bcda 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 ()