summaryrefslogtreecommitdiff
path: root/Omni/Log/Terminal.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-15 09:03:21 -0500
committerBen Sima <ben@bsima.me>2025-11-15 09:03:21 -0500
commite8ff5ae65312229c67a6deb9235ce935709ae173 (patch)
tree758e86a64c0a7486c299ad07efd8a350c2168e03 /Omni/Log/Terminal.hs
parent335a1a4692dc921d6b0b6fab0e93c30063b622d5 (diff)
refactor(bild): simplify terminal output - use --loud flag
- 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.
Diffstat (limited to 'Omni/Log/Terminal.hs')
-rw-r--r--Omni/Log/Terminal.hs22
1 files changed, 6 insertions, 16 deletions
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