From f739541b7e9ef680cc6473d0303f6e1892ddc4f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Thu, 27 Mar 2025 22:01:39 +0100 Subject: Build with ansi-terminal-0.11 Present in Debian bookworm. --- erebos.cabal | 2 +- main/Terminal.hs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/erebos.cabal b/erebos.cabal index ba23d0b..aa16899 100644 --- a/erebos.cabal +++ b/erebos.cabal @@ -196,7 +196,7 @@ executable erebos Paths_erebos build-depends: - ansi-terminal ^>= { 1.1.2 }, + ansi-terminal ^>= { 0.11, 1.0, 1.1 }, bytestring, crypton, directory, diff --git a/main/Terminal.hs b/main/Terminal.hs index 63b8ea2..5dc3612 100644 --- a/main/Terminal.hs +++ b/main/Terminal.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + module Terminal ( Terminal, hasTerminalUI, @@ -72,7 +74,11 @@ hasTerminalUI = termAnsi initTerminal :: CompletionFunc IO -> IO Terminal initTerminal termCompletionFunc = do termLock <- newMVar () +#if MIN_VERSION_ansi_terminal(1, 0, 1) termAnsi <- hNowSupportsANSI stdout +#else + termAnsi <- hSupportsANSI stdout +#endif termPrompt <- newTVarIO "" termShowPrompt <- newTVarIO False termInput <- newTVarIO ( "", "" ) -- cgit v1.2.3