X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2FInteractiveUI.hs;h=80ec79dd2148ec367dec81101812c375a79c5752;hb=3d290c13b56c9b30cf3ef66bd5744415f4dac086;hp=552b61cdc37f24f88ca84fb108be30206c4aec5a;hpb=3f82c82ad95fa95cf0ce3a787c934bcccd2c23c4;p=ghc-hetmet.git diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 552b61c..80ec79d 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -404,8 +404,10 @@ runGHCi paths maybe_exprs = do -- NOTE: this assumes that runInputT won't affect the terminal; -- can we assume this will always be the case? -- This would be a good place for runFileInputT. - Right hdl -> runInputTWithPrefs defaultPrefs defaultSettings $ do + Right hdl -> + do runInputTWithPrefs defaultPrefs defaultSettings $ runCommands $ fileLoop hdl + liftIO (hClose hdl `IO.catch` \_ -> return ()) where getDirectory f = case takeDirectory f of "" -> "."; d -> d