From 669dd3a1ab6c72d530c6480afa1ee54f2353c8a6 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 14 Nov 2025 15:39:38 -0500 Subject: Fix prompt preservation and cleanup extra lines at end - Add initial newline to preserve terminal prompt - Clear each line individually at end instead of just moving cursor - This prevents extra blank lines from remaining on screen --- Omni/Log/Concurrent.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Omni') diff --git a/Omni/Log/Concurrent.hs b/Omni/Log/Concurrent.hs index 4ed8f42..391fcff 100644 --- a/Omni/Log/Concurrent.hs +++ b/Omni/Log/Concurrent.hs @@ -71,6 +71,7 @@ withLineManager maxLines action = do writeIORef namespaceLines Map.empty pure result else do + IO.hPutStrLn IO.stderr "" replicateM_ maxLines (IO.hPutStrLn IO.stderr "") ANSI.hCursorUp IO.stderr maxLines @@ -88,7 +89,11 @@ withLineManager maxLines action = do result <- action mgr - ANSI.hCursorDown IO.stderr maxLines + forM_ [0 .. maxLines - 1] <| \_ -> do + ANSI.hCursorDown IO.stderr 1 + ANSI.hSetCursorColumn IO.stderr 0 + ANSI.hClearLine IO.stderr + writeIORef currentLineManager Nothing writeIORef namespaceLines Map.empty pure result -- cgit v1.2.3