packages feed

ansi-terminal 0.6 → 0.6.1

raw patch · 5 files changed

+102/−10 lines, 5 filesnew-uploader

Files

+ CHANGELOG.md view
@@ -0,0 +1,9 @@+Changes+=======++Version 0.6.1+-------------++* `BoldIntensity` no longer changes background color on Windows+* `setSGR []` was not equivalent to `setSGR [Reset]` on Windows, even though it+  should be according to the documentation. This is now fixed.
+ README.md view
@@ -0,0 +1,78 @@+ansi-terminal+=============++Haskell ANSI Terminal Package For Windows, OS X and Linux++Description+-----------++[ANSI](http://en.wikipedia.org/wiki/ANSI_escape_sequences) terminal+support for Haskell, which allows:++-   Cursor movement+-   Screen and line clearing+-   Color output+-   Showing or hiding the cursor+-   Changing the console title (though this is not strictly part of+    ANSI, it is widely supported in Unix)++It is compatible with Windows (via an emulation layer) and those Unixes+with ANSI terminals.++If you like this, you may be interested in+[ansi-wl-pprint](http://github.com/batterseapower/ansi-wl-pprint), which+provides a pretty-printer that can construct strings containing ANSI+colorisation.++Not all of the ANSI escape codes are provided by this module, but most+(if not all) of the popular and well supported ones are. For a full+list, have a look at the [current version of the+API](http://github.com/feuerbach/ansi-terminal/tree/master/includes/Common-Include.hs).+Each supported escape code or family of codes has a corresponding+function that comes in three variants:++-   A straight `IO` variant that doesn't take a `Handle` and just+    applies the ANSI escape code to the terminal attached to stdout+-   An `IO` variant similar to above, but which takes a `Handle` to+    which the ANSI escape should be applied+-   A `String` variant that returns a literal string that should be+    included to get the effect of the code. This is the only one of the+    three API variants that only works on Unix-like operating systems:+    on Windows these strings will always be blank!++Example+-------++A full example is+[available](http://github.com/feuerbach/ansi-terminal/tree/master/System/Console/ANSI/Example.hs),+but for a taste of how the library works try the following code:++    import System.Console.ANSI++    main = do+        setCursorPosition 5 0+        setTitle "ANSI Terminal Short Example"++        setSGR [ SetConsoleIntensity BoldIntensity+               , SetColor Foreground Vivid Red+               ]+        putStr "Hello"+        +        setSGR [ SetConsoleIntensity NormalIntensity+               , SetColor Foreground Vivid White+               , SetColor Background Dull Blue+               ]+        putStrLn "World!"++![](images/example.png)++Documentation+-------------++Haddock documentation is [available at+Hackage](http://hackage.haskell.org/packages/archive/ansi-terminal/latest/doc/html/System-Console-ANSI.html).++Credits+-------++The library is originally written by [Max Bolingbroke](https://github.com/batterseapower)
− README.textile
@@ -1,3 +0,0 @@-h1. ANSI Terminal--For all information on this package, please consult the "homepage":http://batterseapower.github.com/ansi-terminal
System/Console/ANSI/Windows/Emulator.hs view
@@ -223,12 +223,14 @@     SetColor Background Dull color  -> applyBackgroundANSIColorToAttribute color (attribute .&. (complement bACKGROUND_INTENSITY))     SetColor Background Vivid color -> applyBackgroundANSIColorToAttribute color (attribute .|. bACKGROUND_INTENSITY)   where-    iNTENSITY = fOREGROUND_INTENSITY .|. bACKGROUND_INTENSITY+    iNTENSITY = fOREGROUND_INTENSITY  hSetSGR h sgr = emulatorFallback (Unix.hSetSGR h sgr) $ withHandle h $ \handle -> do     screen_buffer_info <- getConsoleScreenBufferInfo handle     let attribute = csbi_attributes screen_buffer_info-        attribute' = foldl' (flip applyANSISGRToAttribute) attribute sgr+        attribute' = foldl' (flip applyANSISGRToAttribute) attribute+          -- make [] equivalent to [Reset], as documented+          (if null sgr then [Reset] else sgr)     setConsoleTextAttribute handle attribute'  setSGRCode _ = ""
ansi-terminal.cabal view
@@ -1,20 +1,26 @@ Name:                ansi-terminal-Version:             0.6-Cabal-Version:       >= 1.2+Version:             0.6.1+Cabal-Version:       >= 1.6 Category:            User Interfaces Synopsis:            Simple ANSI terminal support, with Windows compatibility Description:         ANSI terminal support for Haskell: allows cursor movement, screen clearing, color output showing or hiding the cursor, and                      changing the title. Compatible with Windows and those Unixes with ANSI terminals, but only GHC is supported as a compiler. License:             BSD3 License-File:        LICENSE-Extra-Source-Files:  README.textile Author:              Max Bolingbroke-Maintainer:          batterseapower@hotmail.com-Homepage:            http://batterseapower.github.com/ansi-terminal+Maintainer:          Roman Cheplyaka <roma@ro-che.info>+Homepage:            https://github.com/feuerbach/ansi-terminal Build-Type:          Simple  Extra-Source-Files:     includes/Common-Include.hs                         includes/Exports-Include.hs+                        CHANGELOG.md+                        README.md+++Source-repository head+  type:     git+  location: git://github.com/feuerbach/ansi-terminal.git  Flag SplitBase         Description:    Choose the new smaller, split-up base package