From c30e41b00d6923a419930ea53b02f2c436118f74 Mon Sep 17 00:00:00 2001 From: Gabriel Gonzalez Date: Mon, 12 Oct 2015 20:04:01 -0700 Subject: [PATCH] Fix external sub-process runners to use line buffering Previously the internal `system`/`systemStrict`/`stream` utilities were using block buffering of the external process' standard input, which made them more difficult to use interactively within `ghci`. --- src/Turtle/Prelude.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Turtle/Prelude.hs b/src/Turtle/Prelude.hs index 13b76c4..6116f9f 100644 --- a/src/Turtle/Prelude.hs +++ b/src/Turtle/Prelude.hs @@ -355,6 +355,7 @@ system p s = liftIO (do let open = do (Just hIn, Nothing, Nothing, ph) <- Process.createProcess p' + IO.hSetBuffering hIn IO.LineBuffering return (hIn, ph) -- Prevent double close @@ -389,6 +390,7 @@ systemStrict p s = liftIO (do let open = do (Just hIn, Just hOut, Nothing, ph) <- liftIO (Process.createProcess p') + IO.hSetBuffering hIn IO.LineBuffering return (hIn, hOut, ph) -- Prevent double close @@ -456,6 +458,7 @@ stream p s = do let open = do (Just hIn, Just hOut, Nothing, ph) <- liftIO (Process.createProcess p') + IO.hSetBuffering hIn IO.LineBuffering return (hIn, hOut, ph) -- Prevent double close