git.iko.soy/lynxjs-elm/compiler
on master help sign in
Fix Dev command: enable stdout line buffering and suppress serve output

- Add LineBuffering to stdout so compilation status messages are visible - Redirect serve process stdout/stderr to NoStream to suppress HTTP logs - Fixes invisible 'Compiling...', 'Recompiling...', and URL messages

commit2fae2e73c395c08c2c38d52ebdb8e994d61df1bc authoriko <mail@iko.soy> dateThu 19 Mar 2026, 09:30 (6 months ago) parente7fa0a8
1 file changed+7−2
terminal/src/Dev.hs+7−2
terminal/src/Dev.hs+7−2
@@ -15,6 +15,7 @@ import qualified Data.Time.Clock.POSIX as Time
1515import qualified System.Directory as Dir
1616import qualified System.Exit as SysExit
1717import System.FilePath ((</>), takeExtension, takeFileName)
18+import System.IO (hSetBuffering, stdout, BufferMode(..))
1819import qualified System.Process as Process
1920
2021import qualified BackgroundWriter as BW
@@ -44,7 +45,8 @@ data Flags =
4445
4546run :: FilePath -> Flags -> IO ()
4647run path (Flags maybePort) =
47− do maybeRoot <- Stuff.findRoot
48+ do hSetBuffering stdout LineBuffering
49+ maybeRoot <- Stuff.findRoot
4850 case maybeRoot of
4951 Nothing ->
5052 putStrLn "I cannot find an elm.json file. Run `lynxjs-elm init` first."
@@ -79,7 +81,10 @@ run path (Flags maybePort) =
7981 -- Start static file server in background
8082 let distDir = bundlerDir </> "dist"
8183 let serveProc = (Process.proc "npx" ["serve", "-l", show port, "-n", distDir])
82− { Process.cwd = Just bundlerDir }
84+ { Process.cwd = Just bundlerDir
85+ , Process.std_out = Process.NoStream
86+ , Process.std_err = Process.NoStream
87+ }
8388 (_, _, _, serveHandle) <- Process.createProcess serveProc
8489
8590 -- Print bundle URL