ansi-terminal 0.6.1.1 → 0.6.2
raw patch · 5 files changed
+39/−17 lines, 5 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +6/−0
- README.md +9/−1
- ansi-terminal.cabal +4/−15
- includes/Common-Include.hs +16/−0
- includes/Exports-Include.hs +4/−1
CHANGELOG.md view
@@ -1,6 +1,12 @@ Changes ======= +Version 0.6.2+---------------++* Add `hSupportsANSI`+* Drop support for `base < 4`+ Version 0.6.1.1 ---------------
README.md view
@@ -66,7 +66,7 @@ putStrLn "World!" ``` -+ Documentation -------------@@ -78,3 +78,11 @@ ------- The library is originally written by [Max Bolingbroke](https://github.com/batterseapower)++Maintainers+-----------++[Roman Cheplyaka](https://github.com/feuerbach) is the primary maintainer.++[Oliver Charles](https://github.com/ocharles) is the backup maintainer. Please+get in touch with him if the primary maintainer cannot be reached.
ansi-terminal.cabal view
@@ -1,5 +1,5 @@ Name: ansi-terminal-Version: 0.6.1.1+Version: 0.6.2 Cabal-Version: >= 1.6 Category: User Interfaces Synopsis: Simple ANSI terminal support, with Windows compatibility@@ -22,10 +22,6 @@ type: git location: git://github.com/feuerbach/ansi-terminal.git -Flag SplitBase- Description: Choose the new smaller, split-up base package- Default: True- Flag Example Description: Build the example application Default: False@@ -37,6 +33,7 @@ Include-Dirs: includes + Build-Depends: base >= 4 && < 5 if os(windows) Build-Depends: Win32 >= 2.0 Cpp-Options: -DWINDOWS@@ -52,11 +49,6 @@ Cpp-Options: -DUNIX Other-Modules: System.Console.ANSI.Unix - if flag(splitBase)- Build-Depends: base >= 3 && < 5- else- Build-Depends: base < 3- Extensions: CPP ForeignFunctionInterface @@ -65,7 +57,7 @@ Executable ansi-terminal-example Main-Is: System/Console/ANSI/Example.hs - Cpp-Options: -Iincludes+ Include-Dirs: includes if os(windows) Build-Depends: Win32 >= 2.0@@ -80,11 +72,8 @@ Cpp-Options: -DUNIX Other-Modules: System.Console.ANSI.Unix - if flag(splitBase)- Build-Depends: base >= 3 && < 5- else- Build-Depends: base < 3 + Build-Depends: base >= 4 && < 5 Extensions: CPP ForeignFunctionInterface
includes/Common-Include.hs view
@@ -1,3 +1,6 @@+import System.Environment+import Control.Applicative+ hCursorUp, hCursorDown, hCursorForward, hCursorBackward :: Handle -> Int -- ^ Number of lines or characters to move -> IO ()@@ -125,3 +128,16 @@ -> String setTitle = hSetTitle stdout++-- | Use heuristics to determine whether the functions defined in this+-- package will work with a given handle.+--+-- The current implementation checks that the handle is a terminal, and+-- that the @TERM@ environment variable doesn't say @dumb@ (whcih is what+-- Emacs sets for its own terminal).+hSupportsANSI :: Handle -> IO Bool+-- Borrowed from an HSpec patch by Simon Hengel+-- (https://github.com/hspec/hspec/commit/d932f03317e0e2bd08c85b23903fb8616ae642bd)+hSupportsANSI h = (&&) <$> hIsTerminalDevice h <*> (not <$> isDumb)+ where+ isDumb = maybe False (== "dumb") <$> lookupEnv "TERM"
includes/Exports-Include.hs view
@@ -47,4 +47,7 @@ -- * Changing the title setTitle, hSetTitle,-setTitleCode+setTitleCode,++-- * Checking if handle supports ANSI+hSupportsANSI