From e8ff5ae65312229c67a6deb9235ce935709ae173 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 15 Nov 2025 09:03:21 -0500 Subject: refactor(bild): simplify terminal output - use --loud flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove BILD_OUTPUT_MODE environment variable - Simplify to 2 modes: MultiLine (≥80 cols) and SingleLine (<80) - Use existing --loud flag to disable concurrent UI entirely - When --loud: show all compiler output line-by-line (for debugging) - When not --loud: adaptive concurrent UI based on terminal width This is simpler and uses the existing --loud flag instead of adding new configuration. The --loud flag was already meant for debugging, so it makes sense to use it to show all output. Note: Omni/Bild.nix updated to include new Omni/Log/Terminal.hs module. Blocked by: stdin bug (see _/llm/STDIN_BUG.md) - cannot test build yet. --- Omni/Log/Terminal.hs | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'Omni/Log/Terminal.hs') diff --git a/Omni/Log/Terminal.hs b/Omni/Log/Terminal.hs index 1230eb3..6d5d70c 100644 --- a/Omni/Log/Terminal.hs +++ b/Omni/Log/Terminal.hs @@ -16,9 +16,8 @@ import qualified System.Console.ANSI as ANSI import qualified System.Environment as Env data OutputMode - = RichMultiLine -- Wide terminals (≥80 cols) - | SingleLine -- Narrow terminals (40-79 cols) - | SimpleFallback -- Very narrow (<40) or dumb terminals + = MultiLine -- Wide terminals (≥80 cols) - reserved lines per namespace + | SingleLine -- Narrow terminals (<80 cols) - rotating single line deriving (Eq, Show) data TerminalInfo = TerminalInfo @@ -33,7 +32,6 @@ detectTerminal :: IO TerminalInfo detectTerminal = do term <- Env.lookupEnv "TERM" area <- Env.lookupEnv "AREA" - modeOverride <- Env.lookupEnv "BILD_OUTPUT_MODE" -- Check if we support ANSI let supportsANSI = case (term, area) of @@ -48,19 +46,11 @@ detectTerminal = do Just (h, w) -> (w, h) Nothing -> (80, 24) -- sensible default - -- Determine mode - let autoMode - | not supportsANSI = SimpleFallback - | width < 40 = SimpleFallback + -- Determine mode based on terminal width + let mode + | not supportsANSI = SingleLine -- Fallback to single line for dumb terminals | width < 80 = SingleLine - | otherwise = RichMultiLine - - -- Allow manual override - let mode = case modeOverride of - Just "simple" -> SimpleFallback - Just "single" -> SingleLine - Just "rich" -> RichMultiLine - _ -> autoMode + | otherwise = MultiLine pure TerminalInfo -- cgit v1.2.3