summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--erebos.cabal2
-rw-r--r--main/Terminal.hs6
2 files changed, 7 insertions, 1 deletions
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 ( "", "" )