From 7125e0e5b631df76f668c7aca78286f86432e7a6 Mon Sep 17 00:00:00 2001 From: Lennart Spitzner Date: Tue, 21 Feb 2023 17:21:40 +0100 Subject: [PATCH] Attempt to force subprocess output to use linewise buffering --- src-hxbrief/Main.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src-hxbrief/Main.hs b/src-hxbrief/Main.hs index 4117a4e..513dbd9 100644 --- a/src-hxbrief/Main.hs +++ b/src-hxbrief/Main.hs @@ -853,6 +853,8 @@ main = B.mainFromCmdParser $ do let mainBlock = P.withCreateProcess ((P.proc restPath restArgs) { P.std_in = P.CreatePipe, P.std_out = P.CreatePipe, P.std_err = P.CreatePipe, P.env = Just innerEnv }) $ \(Just inp) (Just out) (Just err) hdl -> do + System.IO.hSetBuffering out System.IO.LineBuffering + System.IO.hSetBuffering err System.IO.LineBuffering A.withAsync (inHandler inp) $ \inAsync -> A.withAsync (outHandler out) $ \outAsync -> A.withAsync (errHandler err) $ \errAsync -> A.withAsync tickHandler $ \_tickAsync -> do ec <- P.waitForProcess hdl