From 2440b88782e08f3411c7425d6fe496990d68ce9c Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 14 Nov 2025 15:18:23 -0500 Subject: Clean up build output and add [+] for analyzing phase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove all label prefixes from build logs (bild:, nix:, etc) - Show [+] Namespace when first reserving a line (analyzing) - Show [~] Namespace: output when building with subprocess output - Show [✓] Namespace (green) on success - Show [x] Namespace (red) on failure --- Omni/Log/Concurrent.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Omni/Log') diff --git a/Omni/Log/Concurrent.hs b/Omni/Log/Concurrent.hs index 05426aa..47e9404 100644 --- a/Omni/Log/Concurrent.hs +++ b/Omni/Log/Concurrent.hs @@ -119,7 +119,19 @@ reserveLine LineManager {..} ns = linesMap' = Map.insert lineNum (Just status) linesMap in (linesMap', Just lineNum) case mLine of - Just lineNum -> modifyIORef' namespaceLines (Map.insert ns lineNum) + Just lineNum -> do + modifyIORef' namespaceLines (Map.insert ns lineNum) + currentLine <- readIORef lmCurrentLine + ANSI.hSaveCursor IO.stderr + ANSI.hSetCursorColumn IO.stderr 0 + let linesToMove = currentLine - lineNum + when (linesToMove > 0) <| ANSI.hCursorUp IO.stderr linesToMove + when (linesToMove < 0) <| ANSI.hCursorDown IO.stderr (abs linesToMove) + ANSI.hClearLine IO.stderr + let nsText = Text.pack (Namespace.toPath ns) + IO.hPutStr IO.stderr (Text.unpack <| "[+] " <> nsText) + IO.hFlush IO.stderr + ANSI.hRestoreCursor IO.stderr Nothing -> pure () pure mLine where -- cgit v1.2.3