summaryrefslogtreecommitdiff
path: root/Omni/Log/Terminal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Log/Terminal.hs')
-rw-r--r--Omni/Log/Terminal.hs16
1 files changed, 1 insertions, 15 deletions
diff --git a/Omni/Log/Terminal.hs b/Omni/Log/Terminal.hs
index 1a4c717..fd0a617 100644
--- a/Omni/Log/Terminal.hs
+++ b/Omni/Log/Terminal.hs
@@ -1,10 +1,9 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
--- | Terminal detection and output mode selection
+-- | Terminal detection and utilities
module Omni.Log.Terminal
( TerminalInfo (..),
- OutputMode (..),
detectTerminal,
truncateToWidth,
)
@@ -16,15 +15,9 @@ import qualified Data.Text as Text
import qualified System.Console.ANSI as ANSI
import qualified System.Environment as Env
-data OutputMode
- = MultiLine -- Wide terminals (≥80 cols) - reserved lines per namespace
- | SingleLine -- Narrow terminals (<80 cols) - rotating single line
- deriving (Eq, Show)
-
data TerminalInfo = TerminalInfo
{ tiWidth :: Int,
tiHeight :: Int,
- tiMode :: OutputMode,
tiSupportsANSI :: Bool
}
deriving (Eq, Show)
@@ -53,17 +46,10 @@ detectTerminal = do
let (width, height) = case mSize of
Just (h, w) -> (w, h)
Nothing -> (80, 24) -- sensible default
-
- -- Determine mode based on ANSI support
- let mode
- | not supportsANSI = SingleLine -- Fallback to single line for dumb terminals
- | otherwise = MultiLine
-
pure
TerminalInfo
{ tiWidth = width,
tiHeight = height,
- tiMode = mode,
tiSupportsANSI = supportsANSI
}