Skip to content

Commit 558f8cb

Browse files
committed
Merge remote-tracking branch 'origin/buffering'
Conflicts: src/main/Main.hs
2 parents 6b801d1 + 410e1e2 commit 558f8cb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/Main.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,18 @@ import System.Directory (canonicalizePath)
6161
import System.Environment (getArgs, getProgName)
6262
import System.Exit
6363
import System.FilePath (searchPathSeparator)
64-
import System.IO (hIsTerminalDevice, stderr, stdout)
64+
import System.IO (hIsTerminalDevice, stderr, stdin, stdout, hSetBuffering, BufferMode(..))
6565
import System.Process.Read
6666

6767
-- | Commandline dispatcher.
6868
main :: IO ()
6969
main =
70-
do when False $ do -- https://github.com/commercialhaskell/stack/issues/322
70+
do -- Line buffer the output by default, particularly for non-terminal runs.
71+
-- See https://github.com/commercialhaskell/stack/pull/360
72+
hSetBuffering stdout LineBuffering
73+
hSetBuffering stdin LineBuffering
74+
hSetBuffering stderr NoBuffering
75+
when False $ do -- https://github.com/commercialhaskell/stack/issues/322
7176
plugins <- findPlugins (T.pack stackProgName)
7277
tryRunPlugin plugins
7378
progName <- getProgName

0 commit comments

Comments
 (0)