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.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Omni/Log/Terminal.hs b/Omni/Log/Terminal.hs
index 0d2ca7a..6832d17 100644
--- a/Omni/Log/Terminal.hs
+++ b/Omni/Log/Terminal.hs
@@ -46,9 +46,10 @@ detectTerminal = do
-- Get terminal size, catching exceptions from stdin issues
-- When NO_COLOR is set or ANSI is not supported, skip terminal size detection
-- to avoid outputting escape codes
- mSize <- case supportsANSI of
- False -> pure Nothing -- Skip if no ANSI support
- True -> Exception.catch ANSI.getTerminalSize <| \(_ :: Exception.IOException) -> pure Nothing
+ mSize <-
+ if supportsANSI
+ then Exception.catch ANSI.getTerminalSize <| \(_ :: Exception.IOException) -> pure Nothing
+ else pure Nothing -- Skip if no ANSI support
let (width, height) = case mSize of
Just (h, w) -> (w, h)
Nothing -> (80, 24) -- sensible default