From 106e55a50d9609ee16c198030bf869265d63cf2c Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Fri, 12 Feb 2016 07:31:07 +0100 Subject: [PATCH] Terminate ghci process before waiting for it. This change is based on the unconfirmed theory that pressing ^C repeatedly sometimes leaves ghci processes running, with the same symptoms as described in the comment near this change. --- ghci-wrapper/src/Language/Haskell/GhciWrapper.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/ghci-wrapper/src/Language/Haskell/GhciWrapper.hs b/ghci-wrapper/src/Language/Haskell/GhciWrapper.hs index 7797daec..564a28a5 100644 --- a/ghci-wrapper/src/Language/Haskell/GhciWrapper.hs +++ b/ghci-wrapper/src/Language/Haskell/GhciWrapper.hs @@ -88,6 +88,7 @@ close repl = do -- around consuming 100% CPU. This happens when ghci tries to print -- something to stdout in its signal handler (e.g. when it is blocked in -- threadDelay it writes "Interrupted." on SIGINT). + terminateProcess $ process repl e <- waitForProcess $ process repl hClose $ hOut repl