Skip to content

Commit

Permalink
add hFlush when starting repl to avoid edge cases where it would hang…
Browse files Browse the repository at this point in the history
… with no output
  • Loading branch information
danmatichuk committed Oct 2, 2024
1 parent 2b82244 commit 8c154e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/pate-repl/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,11 @@ run rawOpts = do
-- Instead, we delay to wait for the script to make that
-- initial choice, and then 'wait' to start printing
-- the nodes as they are processed.
execReplM $ IO.liftIO $ IO.threadDelay 1000000 >> wait
execReplM $ IO.liftIO $ do
IO.hFlush IO.stdout
IO.threadDelay 500000
IO.hFlush IO.stdout
wait
False ->
-- In all other cases, we just print the initial prompt.
-- The 'tree_ready' lock ensures that we only get to this point
Expand Down

0 comments on commit 8c154e3

Please sign in to comment.