diff options
Diffstat (limited to 'Omni/Log/Concurrent.hs')
| -rw-r--r-- | Omni/Log/Concurrent.hs | 44 |
1 files changed, 5 insertions, 39 deletions
diff --git a/Omni/Log/Concurrent.hs b/Omni/Log/Concurrent.hs index d56d1cc..83289f3 100644 --- a/Omni/Log/Concurrent.hs +++ b/Omni/Log/Concurrent.hs @@ -47,14 +47,6 @@ withLineManager nss action = do termInfo <- detectTerminal case tiMode termInfo of - SimpleFallback -> do - -- Simple mode: no line reservations - let mgr = LineManager {lmNamespaces = nss, lmTermInfo = termInfo} - writeIORef currentLineManager (Just mgr) - result <- action mgr - writeIORef currentLineManager Nothing - writeIORef namespaceLines Map.empty - pure result SingleLine -> do -- Single-line mode: no reservations, updates in place let mgr = LineManager {lmNamespaces = nss, lmTermInfo = termInfo} @@ -64,8 +56,8 @@ withLineManager nss action = do writeIORef currentLineManager Nothing writeIORef namespaceLines Map.empty pure result - RichMultiLine -> do - -- Multi-line mode: reserve lines (existing behavior) + MultiLine -> do + -- Multi-line mode: reserve lines for each namespace let numLines = min (length nss) (tiHeight termInfo - 2) IO.hPutStrLn IO.stderr "" replicateM_ numLines (IO.hPutStrLn IO.stderr "") @@ -88,9 +80,8 @@ withLineManager nss action = do initializeLines :: LineManager -> IO () initializeLines LineManager {..} = case tiMode lmTermInfo of - SimpleFallback -> pure () -- No initialization needed SingleLine -> pure () -- No initialization needed - RichMultiLine -> do + MultiLine -> do nsMap <- readIORef namespaceLines forM_ (Map.toList nsMap) <| \(ns, _) -> do ANSI.hSetCursorColumn IO.stderr 0 @@ -110,15 +101,6 @@ updateLine ns output = do IO.hFlush IO.stderr Just LineManager {..} -> case tiMode lmTermInfo of - SimpleFallback -> do - -- Simple: just print with newline - let nsText = Text.pack (Namespace.toPath ns) - let msg = - if Text.null output - then "[~] " <> nsText - else "[~] " <> nsText <> ": " <> output - IO.hPutStrLn IO.stderr (Text.unpack msg) - IO.hFlush IO.stderr SingleLine -> do -- Single line: update in place let nsText = Text.pack (Namespace.toPath ns) @@ -136,7 +118,7 @@ updateLine ns output = do IO.hPutStr IO.stderr "\r" IO.hPutStr IO.stderr (Text.unpack truncated) IO.hFlush IO.stderr - RichMultiLine -> do + MultiLine -> do -- Multi-line: use reserved lines with truncation nsMap <- readIORef namespaceLines case Map.lookup ns nsMap of @@ -165,22 +147,6 @@ updateLineState ns buildState = do Nothing -> pure () Just LineManager {..} -> case tiMode lmTermInfo of - SimpleFallback -> do - -- Simple: print completion status - let nsText = Text.pack (Namespace.toPath ns) - let (symbol, color) = case buildState of - Success -> ("✓", green) - Failed -> ("x", red) - _ -> ("~", white) - let msg = "[" <> symbol <> "] " <> nsText - case buildState of - Success -> do - Rainbow.hPutChunks IO.stderr [fore color <| chunk msg] - IO.hPutStrLn IO.stderr "" - Failed -> do - Rainbow.hPutChunks IO.stderr [fore color <| chunk msg] - IO.hPutStrLn IO.stderr "" - _ -> pure () SingleLine -> do -- Single line: show completion, keep visible for success/failure let nsText = Text.pack (Namespace.toPath ns) @@ -198,7 +164,7 @@ updateLineState ns buildState = do Failed -> IO.hPutStrLn IO.stderr "" -- Keep failures visible _ -> pure () -- Transient states overwrite IO.hFlush IO.stderr - RichMultiLine -> do + MultiLine -> do -- Multi-line: use reserved lines with truncation nsMap <- readIORef namespaceLines case Map.lookup ns nsMap of |
