From 9381b460049b2924a6aba90e0e20940a83d471b6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 27 Jan 2023 16:51:05 -1000 Subject: [PATCH] fix: lib: fix terminal lightness detection --- hledger-lib/Hledger/Utils/IO.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Utils/IO.hs b/hledger-lib/Hledger/Utils/IO.hs index 8429a3d87..52061d324 100644 --- a/hledger-lib/Hledger/Utils/IO.hs +++ b/hledger-lib/Hledger/Utils/IO.hs @@ -272,7 +272,7 @@ getLayerColor' l = do inemacs <- not.null <$> lookupEnv "INSIDE_EMACS" interactive <- hIsTerminalDevice stdout supportscolor <- hSupportsANSIColor stdout - if inemacs || interactive || not supportscolor then return Nothing + if inemacs || not interactive || not supportscolor then return Nothing else fmap fractionalRGB <$> getLayerColor l where fractionalRGB :: (Fractional a) => RGB Word16 -> RGB a