Skip to content

Commit

Permalink
ConsoleReporter: force flushing of stdout after showCursor
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Nov 27, 2024
1 parent d7efcd4 commit 7d61d98
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/Test/Tasty/Ingredients/ConsoleReporter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,9 @@ consoleTestReporterWithHook hook = TestReporter consoleTestReporterOptions $
isTermColor <- hSupportsANSIColor stdout

(\k -> if isTerm
then (do hideCursor; k) `finally` showCursor
-- When killing with Ctrl+C 'showCursor' can fail
-- to restore terminal cursor if not flushed explicitly
then (do hideCursor; k) `finally` (do showCursor; hFlush stdout)
else k) $ do

hSetBuffering stdout LineBuffering
Expand Down

0 comments on commit 7d61d98

Please sign in to comment.